summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux/linux_ipc.c
diff options
context:
space:
mode:
authorsobomax <sobomax@FreeBSD.org>2005-02-11 13:46:55 +0000
committersobomax <sobomax@FreeBSD.org>2005-02-11 13:46:55 +0000
commit22b03e0f5d8293f08c9542b306e8df039546a47e (patch)
tree67130cbdc4b98a1c48b94789200710cb5282beab /sys/compat/linux/linux_ipc.c
parente6315e1667cea1b6dc6ac179f7640c41ae9db4f9 (diff)
downloadFreeBSD-src-22b03e0f5d8293f08c9542b306e8df039546a47e.zip
FreeBSD-src-22b03e0f5d8293f08c9542b306e8df039546a47e.tar.gz
Semctl with IPC_STAT command should return zero in case of success.
PR: 73778 Submitted by: Andriy Gapon <avg@icyb.net.ua> MFC after: 2 weeks
Diffstat (limited to 'sys/compat/linux/linux_ipc.c')
-rw-r--r--sys/compat/linux/linux_ipc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/compat/linux/linux_ipc.c b/sys/compat/linux/linux_ipc.c
index ddd4f0e..83c0188 100644
--- a/sys/compat/linux/linux_ipc.c
+++ b/sys/compat/linux/linux_ipc.c
@@ -550,8 +550,9 @@ linux_semctl(struct thread *td, struct linux_semctl_args *args)
error = __semctl(td, &bsd_args);
if (error)
return error;
- td->td_retval[0] = IXSEQ_TO_IPCID(bsd_args.semid,
- unptr->buf->sem_perm);
+ td->td_retval[0] = (bsd_args.cmd == SEM_STAT) ?
+ IXSEQ_TO_IPCID(bsd_args.semid, unptr->buf->sem_perm) :
+ 0;
bsd_to_linux_semid_ds(unptr->buf, &linux_semid);
return (linux_semid_pushdown(args->cmd & LINUX_IPC_64,
&linux_semid, (caddr_t)PTRIN(args->arg.buf)));
OpenPOWER on IntegriCloud