From: sos AT prospect DOT com DOT ru (Sergey Okhapkin) Subject: RE: [BUG] spawnlp(_P_WAIT, ...) confused if spawned processes execs 16 Jun 1997 07:39:30 -0700 Sender: mail AT cygnus DOT com Approved: cygnus DOT gnu-win32 AT cygnus DOT com Distribution: cygnus Message-ID: <01BC7A71.C1D6BC60.cygnus.gnu-win32@gater.krystalbank.msk.ru> Original-To: "'gnu-win32 AT cygnus DOT com'" , "'cgf AT bbc DOT com'" Original-Cc: "'Geoffrey Noer'" Encoding: 39 TEXT, 38 UUENCODE X-MS-Attachment: spawn.diff 0 00-00-1980 00:00 Original-Sender: owner-gnu-win32 AT cygnus DOT com 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 > 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. begin 600 spawn.diff M+2TM('-P87=N+F]R:6<)4W5N($IU;B Q-2 R,#HQ,CHQ,R Q.3DW"BLK*R!S M<&%W;BYC8PE-;VX AT 2G5N(#$V(#$V.C P.C0Y(#$Y.3<*0$ @+34W,"PV("LU M-S L."! 0 H@(" @('L*(" @(" @('!I;F9O("IC:&EL9" ]('!R;V-I;F9O M*'!I9"D["B @(" @("!C:&EL9"T^9'=0