Date: Wed, 23 Oct 1996 09:48:02 +0200 (IST) From: Eli Zaretskii To: Juanjo Erauskin Cc: djgpp AT delorie DOT com, DJ Delorie Subject: Re: Problem with popen() In-Reply-To: <326BA2B9.652B@jet.es> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Mon, 21 Oct 1996, Juanjo Erauskin wrote: > "A stream opened by popen should be closed by pclose, which waits > for the associated process to terminate and returns the exit status of > the command. " > > DJGPP pclose() function doesn't return exit status. Return 0 if > pclose is OK or return -1 if pclose doesn't terminate good. The question is: what does POSIX say about `pclose'? DJ? The diff you posted is incomplete, I think. On MSDOS, when you call `popen' to *read* from the pipe, the command is called by `popen', and `pclose' just closes and deletes the temporary file used as the ``pipe''. So in that case, the exit status should be saved by `popen' to be returned later by `pclose'.