hotfix: expression always true, use ::ioctl 89/48589/4
authorKrzysztof Dynowski <k.dynowski@samsung.com>
Wed, 23 Sep 2015 08:54:20 +0000 (10:54 +0200)
committerKrzysztof Dynowski <k.dynowski@samsung.com>
Wed, 23 Sep 2015 10:31:37 +0000 (12:31 +0200)
[Feature/Bug]   mistake in assert check
[Cause]         compilation error, testcase failure
[Solution]      N/A
[Verification]  Build and run tests

Change-Id: Ia9696593c5641a8cc5a2a8b2dc3a9c023609d864

common/utils/fd-utils.cpp
server/input-monitor.cpp

index 9bd7d29..08603fa 100644 (file)
@@ -126,7 +126,7 @@ void setFDFlag(const int fd, const int getOp, const int setOp, const int flag, c
 
 int open(const std::string &path, int flags, mode_t mode)
 {
-    assert(!(flags & O_CREAT || flags & O_TMPFILE) || mode >= 0);
+    assert(!(flags & O_CREAT || flags & O_TMPFILE) || mode != static_cast<unsigned>(-1));
 
     int fd;
 
index 45982af..5ac6e68 100644 (file)
@@ -131,7 +131,7 @@ bool isDeviceWithName(const boost::regex& deviceNameRegex,
     }
 
     char name[DEVICE_NAME_LENGTH];
-    if (ioctl(fd, EVIOCGNAME(sizeof(name)), name) < 0) {
+    if (::ioctl(fd, EVIOCGNAME(sizeof(name)), name) < 0) {
         LOGD("Failed to get the device name of: " << path);
         if (::close(fd) < 0) {
             LOGE("Error during closing file " << path);