From owner-freebsd-hackers Sat Sep 29 9:10: 7 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from air.linkclub.or.jp (air.linkclub.or.jp [210.250.19.40]) by hub.freebsd.org (Postfix) with ESMTP id 18B9937B40C for ; Sat, 29 Sep 2001 09:09:59 -0700 (PDT) Received: from localhost.jp.FreeBSD.org (1Cust157.tnt1.hanno.jp.da.uu.net [63.12.195.157]) by air.linkclub.or.jp (8.11.4/8.11.4) with ESMTP id f8TG58W28445 for ; Sun, 30 Sep 2001 01:05:10 +0900 (JST) (envelope-from toshi@jp.FreeBSD.org) Date: Sun, 30 Sep 2001 00:27:54 +0900 (JST) Message-Id: <200109291527.f8TFRrU76727.toshi@jp.FreeBSD.org> From: Toshihiko ARAI To: freebsd-hackers@FreeBSD.org Subject: Doubt of system(3) X-Mailer: VM 5.96 (beta) / Mule 2.3 (SUETSUMUHANA) based on 19.34.1 Mime-Version: 1.0 (generated by tm-edit 7.106) Content-Type: text/plain; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG I consider the following code of system(3). pid is changed by return value of _wait4(). I feel this need a correction. default: /* parent */ do { pid = _wait4(pid, &pstat, 0, (struct rusage *)0); } while (pid == -1 && errno == EINTR); break; Please review and commit this patch. Index: src/lib/libc/stdlib/system.c =================================================================== RCS file: /home/ncvs/src/lib/libc/stdlib/system.c,v retrieving revision 1.7 diff -u -r1.7 system.c --- src/lib/libc/stdlib/system.c 2001/01/24 13:00:59 1.7 +++ src/lib/libc/stdlib/system.c 2001/09/29 08:53:14 @@ -86,9 +86,9 @@ execl(_PATH_BSHELL, "sh", "-c", command, (char *)NULL); _exit(127); default: /* parent */ - do { - pid = _wait4(pid, &pstat, 0, (struct rusage *)0); - } while (pid == -1 && errno == EINTR); + while (_wait4(pid, &pstat, 0, (struct rusage *)0) == -1 && + errno == EINTR) + ; /* nothing */ break; } (void)_sigaction(SIGINT, &intact, NULL); -- Toshihiko ARAI To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message