This is the mail archive of the
cygwin
mailing list for the Cygwin project.
popen/pclose: unexpected behavior
- From: John O\'Leary <joleary at ichips dot intel dot com>
- To: cygwin at cygwin dot com
- Date: Mon, 3 Oct 2005 18:38:15 +0000 (UTC)
- Subject: popen/pclose: unexpected behavior
Hello,
The following program hangs when its pipes are closed in the same order in
which they were opened, and terminates when its pipes are closed in the
reverse order.
I've never seen this on other platforms - it a bug? Or is there a subtlety I'm
unaware of?
Thanks
--John
----------------------------------------
#include <stdio.h>
int main (void)
{
FILE *pipe1;
FILE *pipe2;
pipe1 = popen ("cat", "w");
pipe2 = popen ("cat", "w");
/* hangs unless pipes are pclosed in order pipe2,pipe1 */
pclose (pipe1);
pclose (pipe2);
return 0;
}
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/