diff options
author | Christopher Faylor <me@cgf.cx> | 2012-03-20 23:13:40 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2012-03-20 23:13:40 +0000 |
commit | 30fa1549395ca75b66472aa2039af0ff772b1c60 (patch) | |
tree | f3adcd570a2407f2b8567d874f9ab057ed8c44d2 /winsup/cygwin | |
parent | c1c62a13681b8eb7e1d43785da464ec4954e0160 (diff) | |
download | newlib-30fa1549395ca75b66472aa2039af0ff772b1c60.zip newlib-30fa1549395ca75b66472aa2039af0ff772b1c60.tar.gz newlib-30fa1549395ca75b66472aa2039af0ff772b1c60.tar.bz2 |
* dtable.cc (set_std_handle): Call SetStdHandle with NULL if fd is closed.
(dtable::release): "Close" standard handle if appropriate.
* dcrt0.cc (dll_crt0_0): Fix minor switch formatting problem.
* fork.cc (frok::parent): Make minor comment indentation change.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r-- | winsup/cygwin/ChangeLog | 8 | ||||
-rw-r--r-- | winsup/cygwin/dcrt0.cc | 14 | ||||
-rw-r--r-- | winsup/cygwin/dtable.cc | 7 | ||||
-rw-r--r-- | winsup/cygwin/fork.cc | 10 |
4 files changed, 25 insertions, 14 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index cae9015..601c730 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,11 @@ +2012-03-20 Christopher Faylor <me.cygwin2012@cgf.cx> + + * dtable.cc (set_std_handle): Call SetStdHandle with NULL if fd is + closed. + (dtable::release): "Close" standard handle if appropriate. + * dcrt0.cc (dll_crt0_0): Fix minor switch formatting problem. + * fork.cc (frok::parent): Make minor comment indentation change. + 2012-03-20 Corinna Vinschen <corinna@vinschen.de> * syscalls.cc (lseek): Fix debug output. diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc index d35ca6b..63eaa70 100644 --- a/winsup/cygwin/dcrt0.cc +++ b/winsup/cygwin/dcrt0.cc @@ -744,13 +744,13 @@ dll_crt0_0 () cygwin_user_h = child_proc_info->user_h; switch (child_proc_info->type) { - case _CH_FORK: - fork_info->handle_fork (); - break; - case _CH_SPAWN: - case _CH_EXEC: - spawn_info->handle_spawn (); - break; + case _CH_FORK: + fork_info->handle_fork (); + break; + case _CH_SPAWN: + case _CH_EXEC: + spawn_info->handle_spawn (); + break; } } diff --git a/winsup/cygwin/dtable.cc b/winsup/cygwin/dtable.cc index 7f414ac..69add31 100644 --- a/winsup/cygwin/dtable.cc +++ b/winsup/cygwin/dtable.cc @@ -65,10 +65,11 @@ dtable_init () void __stdcall set_std_handle (int fd) { + fhandler_base *fh = cygheap->fdtab[fd]; if (fd == 0) - SetStdHandle (std_consts[fd], cygheap->fdtab[fd]->get_handle ()); + SetStdHandle (std_consts[fd], fh ? fh->get_handle () : NULL); else if (fd <= 2) - SetStdHandle (std_consts[fd], cygheap->fdtab[fd]->get_output_handle ()); + SetStdHandle (std_consts[fd], fh ? fh->get_output_handle () : NULL); } int @@ -244,6 +245,8 @@ dtable::release (int fd) dec_need_fixup_before (); fds[fd]->refcnt (-1); fds[fd] = NULL; + if (fd <= 2) + set_std_handle (fd); } extern "C" int diff --git a/winsup/cygwin/fork.cc b/winsup/cygwin/fork.cc index d014cc9..2cd4c2f 100644 --- a/winsup/cygwin/fork.cc +++ b/winsup/cygwin/fork.cc @@ -354,14 +354,14 @@ frok::parent (volatile char * volatile stack_here) while (1) { hchild = NULL; - rc = CreateProcessW (myself->progname, /* image to run */ - myself->progname, /* what we send in arg0 */ + rc = CreateProcessW (myself->progname, /* image to run */ + myself->progname, /* what we send in arg0 */ &sec_none_nih, &sec_none_nih, - TRUE, /* inherit handles from parent */ + TRUE, /* inherit handles from parent */ c_flags, - NULL, /* environment filled in later */ - 0, /* use current drive/directory */ + NULL, /* environment filled in later */ + 0, /* use current drive/directory */ &si, &pi); |