ir: Return permission denied error for permission denied cases 96/105996/1 accepted/tizen/3.0/common/20161221.181146 accepted/tizen/3.0/ivi/20161221.010638 accepted/tizen/3.0/mobile/20161221.011046 accepted/tizen/3.0/tv/20161221.010517 accepted/tizen/3.0/wearable/20161221.010656 submit/tizen_3.0/20161220.072503
authorpr.jung <pr.jung@samsung.com>
Tue, 20 Dec 2016 07:18:28 +0000 (16:18 +0900)
committerpr.jung <pr.jung@samsung.com>
Tue, 20 Dec 2016 07:18:28 +0000 (16:18 +0900)
Change-Id: I9eae094619dc06fd2dec0ef788bdc73b946860bb
Signed-off-by: pr.jung <pr.jung@samsung.com>
src/ir.c

index 8675605..4e802c1 100644 (file)
--- a/src/ir.c
+++ b/src/ir.c
@@ -49,6 +49,8 @@ int device_ir_is_available(bool *available)
                        NULL, NULL);
 
 //LCOV_EXCL_START System Error
+       if (ret == -EACCES || ret == -EPERM)
+               return DEVICE_ERROR_PERMISSION_DENIED;
        if (!ret) {
                *available = false;
                return DEVICE_ERROR_OPERATION_FAILED;
@@ -98,6 +100,8 @@ int device_ir_transmit(int carrier_frequency, int *pattern, int size)
                        "ai", arr);
 
 //LCOV_EXCL_START System Error
+       if (ret == -EACCES || ret == -EPERM)
+               return DEVICE_ERROR_PERMISSION_DENIED;
        if (ret < 0)
                return DEVICE_ERROR_OPERATION_FAILED;
 //LCOV_EXCL_STOP