The O_* variales are integers and aren't not suitable with bit
operation, because O_RDONLY is 0, so if the mode is O_RDONLY, (mode &
O_RDONLY) always return false. So the access mode is always 0,
that means F_OK rather than R_OK.
Change-Id: If750f85864d32f7d0a039b2ee114ef133a311434
Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
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)) {