Fix incorrect access mode check
[framework/system/dlog.git] / logutil.c
index 671efee..d9d369f 100755 (executable)
--- a/logutil.c
+++ b/logutil.c
@@ -661,8 +661,8 @@ int main(int argc, char **argv)
         g_dev_count = 1;
 
         int accessmode =
-                  (mode & O_RDONLY) ? R_OK : 0
-                | (mode & O_WRONLY) ? W_OK : 0;
+                  (mode == O_RDONLY) ? R_OK : 0
+                | (mode == O_WRONLY) ? W_OK : 0;
 
        // only add this if it's available
        if (0 == access("/dev/"LOGGER_LOG_SYSTEM, accessmode)) {