delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/10/03/14:52:12

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
To: cygwin AT cygwin DOT com
From: John =?utf-8?b?T1wnTGVhcnk=?= <joleary AT ichips DOT intel DOT com>
Subject: popen/pclose: unexpected behavior
Date: Mon, 3 Oct 2005 18:38:15 +0000 (UTC)
Lines: 31
Message-ID: <loom.20051003T202434-582@post.gmane.org>
Mime-Version: 1.0
User-Agent: Loom/3.14 (http://gmane.org/)
X-IsSubscribed: yes

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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019