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>2001-11-10 22:46:15 +0300
committerChristopher Faylor <me@cgf.cx>2001-11-10 22:46:15 +0300
commitc8b345282934affedf2fb4a1e045d12feb7aa850 (patch)
treeca5dd6599e90d65929b0a0a940acdeb4dc876b21 /winsup/cygwin/dtable.cc
parent4d2f5ef1da9610f42f8c8956820ea1dab449749a (diff)
* dtable.cc (dtable::build_fhandler): Don't increment console fd count if new
operation fails. Increment fork_fixup field here. (dtable::dup2): Don't increment fork_fixup field here. (fdsock): Ditto.
Diffstat (limited to 'winsup/cygwin/dtable.cc')
-rw-r--r--winsup/cygwin/dtable.cc11
1 files changed, 4 insertions, 7 deletions
diff --git a/winsup/cygwin/dtable.cc b/winsup/cygwin/dtable.cc
index 3cf52c087..4ae3871c1 100644
--- a/winsup/cygwin/dtable.cc
+++ b/winsup/cygwin/dtable.cc
@@ -271,8 +271,8 @@ dtable::build_fhandler (int fd, DWORD dev, const char *name, int unit)
case FH_CONSOLE:
case FH_CONIN:
case FH_CONOUT:
- fh = cnew (fhandler_console) ();
- inc_console_fds ();
+ if ((fh = cnew (fhandler_console) ()))
+ inc_console_fds ();
break;
case FH_PTYM:
fh = cnew (fhandler_pty_master) ();
@@ -295,7 +295,8 @@ dtable::build_fhandler (int fd, DWORD dev, const char *name, int unit)
fh = cnew (fhandler_pipe) ();
break;
case FH_SOCKET:
- fh = cnew (fhandler_socket) ();
+ if ((fh = cnew (fhandler_socket) ()))
+ inc_need_fixup_before ();
break;
case FH_DISK:
fh = cnew (fhandler_disk_file) ();
@@ -401,10 +402,6 @@ dtable::dup2 (int oldfd, int newfd)
_close (newfd);
fds[newfd] = newfh;
- /* Count sockets. */
- if ((fds[newfd]->get_device () & FH_DEVMASK) == FH_SOCKET)
- inc_need_fixup_before ();
-
ReleaseResourceLock (LOCK_FD_LIST, WRITE_LOCK | READ_LOCK, "dup");
MALLOC_CHECK;