NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
bin/41864: /bin/sh's wait built-in returns wrong exit status
>Number: 41864
>Category: bin
>Synopsis: /bin/sh's wait built-in returns wrong exit status
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: bin-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Aug 10 09:20:00 +0000 2009
>Originator: Stathis Kamperis
>Release: NetBSD 5.0_STABLE
>Organization:
Aristotle University of Thessaloniki
>Environment:
NetBSD voyager 5.0_STABLE NetBSD 5.0_STABLE (MYGENERIC) #9: Wed Aug 5 00:38:20
EEST 2009 root@voyager:/usr/obj/sys/arch/i386/compile/MYGENERIC i386
>Description:
~% cat lala.sh
#!/usr/pkg/bin/bash
true &
pid=$!
sleep 1
wait $pid
echo $?
~% ./lala.sh
0
~% cat lala.sh
#!/bin/sh
true &
pid=$!
sleep 1
wait $pid
echo $?
~% ./lala.sh
127 <--- this shouldn't happen
~%
If I remove the sleep command, sh returns the right exit status.
I guess it has trouble remembering the exit status of an arbitrary command
invocation,
if between that command and the call to wait, another command is interpolated.
In DragonFlyBSD that I checked, it works ok (both bash and sh return the same
exit status).
>How-To-Repeat:
>Fix:
Home |
Main Index |
Thread Index |
Old Index