diff options
Diffstat (limited to 'sys/compat/linux/linux_ipc.c')
-rw-r--r-- | sys/compat/linux/linux_ipc.c | 5 |
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))); |