* dtable.h (dtable::in_vfork_cleanup): New function. True if vfork cleanup

needed.
* dtable.cc (dtable::vfork_parent_restore): Remove assertion.
* pipe.cc (fhandler_pipe::close): Don't close read_state during fork_fixup
since it wasn't inherited.
This commit is contained in:
Christopher Faylor 2003-01-03 06:20:23 +00:00
parent 7b061fd844
commit f3afe99b0b
5 changed files with 11 additions and 3 deletions

View File

@ -1,3 +1,11 @@
2003-01-03 Christopher Faylor <cgf@redhat.com>
* dtable.h (dtable::in_vfork_cleanup): New function. True if vfork
cleanup needed.
* dtable.cc (dtable::vfork_parent_restore): Remove assertion.
* pipe.cc (fhandler_pipe::close): Don't close read_state during
fork_fixup since it wasn't inherited.
2003-01-01 Christopher Faylor <cgf@redhat.com> 2003-01-01 Christopher Faylor <cgf@redhat.com>
* passwd.cc (getpwuid_r32): Revert previous change. * passwd.cc (getpwuid_r32): Revert previous change.

View File

@ -675,7 +675,6 @@ dtable::vfork_parent_restore ()
close_all_files (); close_all_files ();
fhandler_base **deleteme = fds; fhandler_base **deleteme = fds;
assert (fds_on_hold != NULL);
fds = fds_on_hold; fds = fds_on_hold;
fds_on_hold = NULL; fds_on_hold = NULL;
cfree (deleteme); cfree (deleteme);

View File

@ -79,6 +79,7 @@ public:
void stdio_init (); void stdio_init ();
void get_debugger_info (); void get_debugger_info ();
void set_file_pointers_for_exec (); void set_file_pointers_for_exec ();
bool in_vfork_cleanup () {return fds_on_hold == fds;}
}; };
void dtable_init (void); void dtable_init (void);

View File

@ -1130,7 +1130,7 @@ void
events_init (void) events_init (void)
{ {
char *name; char *name;
/* title_mutex protects modification of console title. It's neccessary /* title_mutex protects modification of console title. It's necessary
while finding console window handle */ while finding console window handle */
if (!(title_mutex = CreateMutex (&sec_all_nih, FALSE, if (!(title_mutex = CreateMutex (&sec_all_nih, FALSE,

View File

@ -90,7 +90,7 @@ int fhandler_pipe::close ()
CloseHandle (guard); CloseHandle (guard);
if (writepipe_exists) if (writepipe_exists)
CloseHandle (writepipe_exists); CloseHandle (writepipe_exists);
if (read_state) if (read_state && !cygheap->fdtab.in_vfork_cleanup ())
CloseHandle (read_state); CloseHandle (read_state);
return res; return res;
} }