diff options
author | Ruediger Meier | 2018-06-25 14:01:21 +0200 |
---|---|---|
committer | Ruediger Meier | 2018-06-25 16:49:00 +0200 |
commit | 77845f7bd75cc1f1ac69bfae38a78aa81ae3fb60 (patch) | |
tree | 495e14937f2ba3fea963d913ee58252b044112f5 /sys-utils/ipcutils.c | |
parent | docs: update TODO (diff) | |
download | kernel-qcow2-util-linux-77845f7bd75cc1f1ac69bfae38a78aa81ae3fb60.tar.gz kernel-qcow2-util-linux-77845f7bd75cc1f1ac69bfae38a78aa81ae3fb60.tar.xz kernel-qcow2-util-linux-77845f7bd75cc1f1ac69bfae38a78aa81ae3fb60.zip |
ipcs,chmem: fix access() usage
Some mistakes happened lately when switching from path_exist()
to ul_path_access(). See f09a98de and 8ca31279.
This caused ipcs test failures when running i386 binaries on x86_64
hosts, because the syscall fallback was always used. That's why I
reviewed all similar changes and found another one in chmem.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Diffstat (limited to 'sys-utils/ipcutils.c')
-rw-r--r-- | sys-utils/ipcutils.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sys-utils/ipcutils.c b/sys-utils/ipcutils.c index e6dd0c561..5fe297fd4 100644 --- a/sys-utils/ipcutils.c +++ b/sys-utils/ipcutils.c @@ -18,9 +18,9 @@ int ipc_msg_get_limits(struct ipc_limits *lim) { - if (access(_PATH_PROC_IPC_MSGMNI, F_OK) && - access(_PATH_PROC_IPC_MSGMNB, F_OK) && - access(_PATH_PROC_IPC_MSGMAX, F_OK)) { + if (access(_PATH_PROC_IPC_MSGMNI, F_OK) == 0 && + access(_PATH_PROC_IPC_MSGMNB, F_OK) == 0 && + access(_PATH_PROC_IPC_MSGMAX, F_OK) == 0) { ul_path_read_s32(NULL, &lim->msgmni, _PATH_PROC_IPC_MSGMNI); ul_path_read_s32(NULL, &lim->msgmnb, _PATH_PROC_IPC_MSGMNB); @@ -71,9 +71,9 @@ int ipc_shm_get_limits(struct ipc_limits *lim) { lim->shmmin = SHMMIN; - if (access(_PATH_PROC_IPC_SHMALL, F_OK) && - access(_PATH_PROC_IPC_SHMMAX, F_OK) && - access(_PATH_PROC_IPC_SHMMNI, F_OK)) { + if (access(_PATH_PROC_IPC_SHMALL, F_OK) == 0 && + access(_PATH_PROC_IPC_SHMMAX, F_OK) == 0 && + access(_PATH_PROC_IPC_SHMMNI, F_OK) == 0) { ul_path_read_u64(NULL, &lim->shmall, _PATH_PROC_IPC_SHMALL); ul_path_read_u64(NULL, &lim->shmmax, _PATH_PROC_IPC_SHMMAX); |