From 282fae35d67c4450def98cc6289ef0d97287edf0 Mon Sep 17 00:00:00 2001 From: Maxim Sobolev Date: Fri, 11 Feb 2005 13:46:55 +0000 Subject: [PATCH] Semctl with IPC_STAT command should return zero in case of success. PR: 73778 Submitted by: Andriy Gapon MFC after: 2 weeks --- sys/compat/linux/linux_ipc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/compat/linux/linux_ipc.c b/sys/compat/linux/linux_ipc.c index ddd4f0e81c6..83c018873f1 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)));