public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* popen/pclose: unexpected behavior
@ 2005-10-03 18:52 John O\'Leary
  0 siblings, 0 replies; only message in thread
From: John O\'Leary @ 2005-10-03 18:52 UTC (permalink / raw)
  To: cygwin

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/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-10-03 18:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-03 18:52 popen/pclose: unexpected behavior John O\'Leary

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).