From: TaeminYeom Date: Tue, 21 Mar 2023 01:48:29 +0000 (+0900) Subject: common: Add permission denied return value X-Git-Tag: accepted/tizen/unified/20230322.080549^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=20f273099fe0393bf839a7911eec3b495bc441bd;p=platform%2Fcore%2Fapi%2Fperipheral-io.git common: Add permission denied return value When apps attempt to open, read or write the device node without permission, API should return PERIPHERAL_ERROR_PERMISSION_DENIED. So, add it in CHECK_ERROR macro. Change-Id: I862da7c08d96fd1506b89834a5721832f7e42ea1 Signed-off-by: TaeminYeom --- diff --git a/src/common.h b/src/common.h index 45a1a54..be79a74 100644 --- a/src/common.h +++ b/src/common.h @@ -38,6 +38,8 @@ return PERIPHERAL_ERROR_TRY_AGAIN; \ if (errno == EINVAL) \ return PERIPHERAL_ERROR_INVALID_PARAMETER; \ + if (errno == EACCES) \ + return PERIPHERAL_ERROR_PERMISSION_DENIED; \ char errmsg[MAX_ERR_LEN]; \ strerror_r(errno, errmsg, sizeof(errmsg)); \ _E("Failed the %s(%d) function. errmsg: %s", __FUNCTION__, __LINE__, errmsg); \