Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2005-04-16 09:20:01 +0400
committerChristopher Faylor <me@cgf.cx>2005-04-16 09:20:01 +0400
commit06e18175e0fef5cda73bb1c0a9697e81ed28732a (patch)
treec524d1098dc512e84275fc72b9474e246f7992a5 /winsup/cygwin/fhandler_fifo.cc
parentf40d6122ff203b48d23182ac3c70727ed694f205 (diff)
* fhandler.cc (fhandler::dup): Duplicate flags, too.
* fhandler.h (fhandler_fifo::owner): Eliminate. * fhandler_disk_file.cc (fhandler_base::fstat_fs): Handle on-disk devices better. (fhandler_base::fstat_helper): Ditto. * fhandler_fifo.cc (fhandler_fifo::fhandler_fifo): Don't initialize obsolete "owner". (fhandler_fifo::open_not_mine): Add some debugging. Duplicate correct handle when we own it. (fhandler_fifo::open): Set flags from input, not from first pipe. Flag that fork fixup is needed. (fhandler_fifo::dup): Set errno correctly when DuplicateHandle fails. * pinfo.cc (commune_send): Add debugging for fifo. * cygwin/version.h: Bump API minor version to 127 to reflect exporting of sigrelese.
Diffstat (limited to 'winsup/cygwin/fhandler_fifo.cc')
-rw-r--r--winsup/cygwin/fhandler_fifo.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc
index 6026deff8..5431f1005 100644
--- a/winsup/cygwin/fhandler_fifo.cc
+++ b/winsup/cygwin/fhandler_fifo.cc
@@ -1,6 +1,6 @@
-/* fhandler_fifo.cc. See fhandler.h for a description of the fhandler classes.
+/* fhandler_fifo.cc - See fhandler.h for a description of the fhandler classes.
- Copyright 2002, 2003, 2004 Red Hat, Inc.
+ Copyright 2002, 2003, 2004, 2005 Red Hat, Inc.
This file is part of Cygwin.
@@ -23,7 +23,7 @@
#include "pinfo.h"
fhandler_fifo::fhandler_fifo ()
- : fhandler_pipe (), output_handle (NULL), owner (NULL),
+ : fhandler_pipe (), output_handle (NULL),
read_use (0), write_use (0)
{
}
@@ -85,6 +85,8 @@ fhandler_fifo::open_not_mine (int flags)
r = p->commune_send (PICOM_FIFO, get_win32_name ());
if (r.handles[0] == NULL)
continue; // process doesn't own fifo
+ debug_printf ("pid %d, handles[0] %p, handles[1] %p", p->pid,
+ r.handles[0], r.handles[1]);
}
else
{
@@ -162,6 +164,7 @@ fhandler_fifo::open (int flags, mode_t)
delete (fhs[0]);
delete (fhs[1]);
set_use (1);
+ need_fork_fixup (true);
}
out:
@@ -170,17 +173,17 @@ out:
}
int
-fhandler_fifo::dup (fhandler_base * child)
+fhandler_fifo::dup (fhandler_base *child)
{
int res = fhandler_pipe::dup (child);
if (!res)
{
fhandler_fifo *ff = (fhandler_fifo *) child;
-
if (!DuplicateHandle (hMainProc, get_output_handle (), hMainProc,
&ff->get_output_handle (), false, true,
DUPLICATE_SAME_ACCESS))
{
+ __seterrno ();
child->close ();
res = -1;
}