Subject: RE: [BUG] spawnlp(_P_WAIT, ...) confused if spawned processes execs
From: [email-masked] (Sergey Okhapkin)

16 Jun 1997 07:39:30 -0700
Sender: [email-masked]
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Original-To: "[email-masked]'" <[email-masked]>,
        "[email-masked]'"
	 <[email-masked]>
Original-Cc: "'Geoffrey Noer'" <[email-masked]>
Encoding: 39 TEXT, 38 UUENCODE
X-MS-Attachment: spawn.diff 0 00-00-1980 00:00
Original-Sender: [email-masked]

Chris Faylor wrote:
> The test case below illustrates a problem with spawnlp.  The correct
> sequence of output should be something like:
> 
> first
> second
> exited
> 
> It is instead:
> 
> first
> exited
> second

> I once again, think that this would be difficult to fix, but maybe Sergey
> will prove me wrong.  I love to be proven wrong when the result is better
> software!

:-)

> 
> #include <process.h>
> main()
> {
> spawnlp(_P_WAIT, "sh", "sh", "-c",
> 	"echo first; exec sh -c \"sleep 2; echo second\"", 0);
> printf("exited\n", ret);
> exit(0);
> }

Thank You! Fixed :-)

-- 
Sergey Okhapkin, http://www.lexa.ru/sos
Moscow, Russia
Looking for a job.

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".