From: Roland McGrath Date: Mon, 24 Jan 1994 23:01:28 +0000 (+0000) Subject: Formerly sysdeps/unix/sysv/sysv4/__waitpid.c.~3~ X-Git-Tag: glibc-2.16-ports-before-merge~4181 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0312ea95d955e74420995374422ae97acfec91e6;p=thirdparty%2Fglibc.git Formerly sysdeps/unix/sysv/sysv4/__waitpid.c.~3~ --- diff --git a/sysdeps/unix/sysv/sysv4/waitpid.c b/sysdeps/unix/sysv/sysv4/waitpid.c index 4466141b19d..4fd167a4058 100644 --- a/sysdeps/unix/sysv/sysv4/waitpid.c +++ b/sysdeps/unix/sysv/sysv4/waitpid.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993 Free Software Foundation, Inc. +/* Copyright (C) 1993, 1994 Free Software Foundation, Inc. Contributed by Brendan Kehoe (brendan@zen.org). The GNU C Library is free software; you can redistribute it and/or @@ -95,5 +95,9 @@ DEFUN(__waitpid, (__pid, __stat_loc, __options), } *__stat_loc = infop.__status; - return __pid; + + /* Return the PID out of the INFOP structure instead of the one we were + called with, to account for cases of being called with -1 to signify + any PID. */ + return infop.__pid; }