Subject: Re: bin/35055: /bin/sh wait bug
To: None <gnats-admin@netbsd.org, netbsd-bugs@netbsd.org,>
From: dieter roelants <dieter.r@pandora.be>
List: netbsd-bugs
Date: 11/25/2006 22:10:03
The following reply was made to PR bin/35055; it has been noted by GNATS.
From: dieter roelants <dieter.r@pandora.be>
To: gnats-bugs@NetBSD.org
Cc: keiji@hiemalis.org
Subject: Re: bin/35055: /bin/sh wait bug
Date: Sat, 25 Nov 2006 23:08:58 +0100
> #!/bin/sh
> #!/emul/freebsd/bin/sh
> sleep 3 &
> sleep 1 &
>
> wait %1
> r1=$?
> echo $r1
> wait %2
> r2=$?
> echo $r2
> -----
> Both r1 and r2 should be 0.
Why do you think so? By the time the first wait returns, the second sleep has finished and so you don't have a job 2 anymore. 127 is the return value wait gives when you specify a non-existing child.
> But exec this sh program, r1 is 0, r2 is 127.
Seems right to me...
Kind regards
dieter