From owner-freebsd-hackers Fri Dec 22 01:15:05 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id BAA14563 for hackers-outgoing; Fri, 22 Dec 1995 01:15:05 -0800 (PST) Received: from unix.stylo.it ([194.21.207.250]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id BAA14550 for ; Fri, 22 Dec 1995 01:14:58 -0800 (PST) Received: from trust.stylo.it (trust.stylo.it [194.21.207.253]) by unix.stylo.it (8.6.11/8.6.9) with SMTP id KAA03662; Fri, 22 Dec 1995 10:15:45 +0100 Received: by trust.stylo.it with NT SMTP Gateway ver 31 id <30DA75B4@trust.stylo.it>; Fri, 22 Dec 95 10:09:08 W From: Angelo Turetta To: freebsd-hackers , "'SMTP:tsingle@sunland.gsfc.nasa.gov'" Subject: Re: semctl() portability issue and fix Date: Fri, 22 Dec 95 10:09:00 W Message-ID: <30DA75B4@trust.stylo.it> Encoding: 19 TEXT X-Mailer: Microsoft Mail V3.0 Sender: owner-hackers@freebsd.org Precedence: bulk As Tim Singletary wrote: > if (cmd == IPC_SET || cmd == IPC_STAT || cmd == GETALL > || cmd == SETVAL || cmd == SETALL) { > fourth_arg = va_arg(ap, union semun); > fourth_arg_ptr = &fourth_arg; > } > fourth_arg_ptr = NULL; > va_end(ap); > > return (semsys(0, semid, semnum, cmd, fourth_arg_ptr)); Probably a typo, but it seems to me fourth_arg_ptr will always be NULL upon call to semsys. Better to put an 'else' before it (or at least move assignment BEFORE the if statement ) :-) :-) Angelo.