www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1998/09/18/07:48:27

From: sos AT prospect DOT com DOT ru (Sergey Okhapkin)
Subject: pipe.cc fix
18 Sep 1998 07:48:27 -0700 :
Message-ID: <01BDE331.9F81F9C0.cygnus.cygwin32.developers@sos>
To: "'cygwin32-developers AT cygnus DOT com'" <cygwin32-developers AT cygnus DOT com>

Hi!

pipe.cc	(make_pipe): set close-on-exec flag for non-inheritable pipes.

--- pipe.cc.orig        Fri Sep 11 10:15:23 1998
+++ pipe.cc     Fri Sep 18 15:56:33 1998
@@ -37,6 +37,11 @@ make_pipe (int fildes[2], unsigned int p
       int binmode = !!(mode & O_BINARY);
       fhr->init (r, binmode, GENERIC_READ);
       fhw->init (w, binmode, GENERIC_WRITE);
+      if (mode & O_NOINHERIT)
+       {
+         fhr->set_close_on_exec_flag (1);
+         fhw->set_close_on_exec_flag (1);
+       }

       fildes[0] = fdr;
       fildes[1] = fdw;

-- 
Sergey Okhapkin, http://www.lexa.ru/sos
Moscow, Russia


- Raw text -


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