diff options
author | Christopher Faylor <me@cgf.cx> | 2001-06-16 17:09:19 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2001-06-16 17:09:19 +0000 |
commit | 99a5bd2fab6ba7e81ffa3d0709199b75264a3651 (patch) | |
tree | f0fba41311108a8d0f33025cd6bee718e864d055 /winsup/cygwin | |
parent | 947ab99ee964fe52e1c02f2d6e63e50bb533fcc0 (diff) | |
download | newlib-99a5bd2fab6ba7e81ffa3d0709199b75264a3651.zip newlib-99a5bd2fab6ba7e81ffa3d0709199b75264a3651.tar.gz newlib-99a5bd2fab6ba7e81ffa3d0709199b75264a3651.tar.bz2 |
* exceptions.cc (sig_handle_tty_stop): Reset PID_STOPPED if not actually
stopping.
* fhandler_console.cc (fhandler_console::fixup_after_fork): Don't set
controlling terminal if just inheriting a handle.
(fhandler_console::fixup_after_exec): Ditto.
* fhandler_tty.cc (fhandler_tty_slave::init): Ditto.
* signal.cc (kill_worker): Set appropriate errno if proc_exists determines that
process does not really exist.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r-- | winsup/cygwin/ChangeLog | 13 | ||||
-rw-r--r-- | winsup/cygwin/exceptions.cc | 5 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_console.cc | 4 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_tty.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/path.cc | 3 | ||||
-rw-r--r-- | winsup/cygwin/signal.cc | 6 |
6 files changed, 25 insertions, 8 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index e32840c..218b0c7 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,14 @@ +Sat Jun 16 13:06:49 2001 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (sig_handle_tty_stop): Reset PID_STOPPED if not + actually stopping. + * fhandler_console.cc (fhandler_console::fixup_after_fork): Don't set + controlling terminal if just inheriting a handle. + (fhandler_console::fixup_after_exec): Ditto. + * fhandler_tty.cc (fhandler_tty_slave::init): Ditto. + * signal.cc (kill_worker): Set appropriate errno if proc_exists + determines that process does not really exist. + Fri Jun 15 14:34:19 2001 Christopher Faylor <cgf@cygnus.com> * path.cc (path_conv::check): Deal more robustly with foo/ behavior. @@ -2422,7 +2433,7 @@ Wed Jan 17 09:47:13 2001 Christopher Faylor <cgf@cygnus.com> * exceptions.cc (sig_handle_tty_stop): Move setting of PID_STOPPED to earlier in interrupt. - ((interrupt_setup): i.e., here. + (interrupt_setup): i.e., here. (sig_handle): Don't queue multiple SIGSTOPS. * fhandler.h (bg_check_types): Enumerate return value of bg_check for clarity. diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc index 82ba131..9ec179b 100644 --- a/winsup/cygwin/exceptions.cc +++ b/winsup/cygwin/exceptions.cc @@ -587,7 +587,10 @@ sig_handle_tty_stop (int sig) /* Silently ignore attempts to suspend if there is no accomodating cygwin parent to deal with this behavior. */ if (!myself->ppid_handle) - return; + { + myself->process_state &= ~PID_STOPPED; + return; + } myself->stopsig = sig; /* See if we have a living parent. If so, send it a special signal. * It will figure out exactly which pid has stopped by scanning diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc index cf95ecc..b09eeff 100644 --- a/winsup/cygwin/fhandler_console.cc +++ b/winsup/cygwin/fhandler_console.cc @@ -1728,7 +1728,7 @@ fhandler_console::fixup_after_fork (HANDLE) /* Windows does not allow duplication of console handles between processes so open the console explicitly. */ - if (!open (get_name (), get_flags (), 0)) + if (!open (get_name (), O_NOCTTY | get_flags (), 0)) system_printf ("error opening console after fork, %E"); if (!get_close_on_exec ()) @@ -1758,7 +1758,7 @@ fhandler_console::fixup_after_exec (HANDLE) HANDLE h = get_handle (); HANDLE oh = get_output_handle (); - if (!open (get_name (), get_flags (), 0)) + if (!open (get_name (), O_NOCTTY | get_flags (), 0)) { int sawerr = 0; if (!get_io_handle ()) diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index 293f4e6..f0076ca 100644 --- a/winsup/cygwin/fhandler_tty.cc +++ b/winsup/cygwin/fhandler_tty.cc @@ -574,7 +574,7 @@ fhandler_tty_slave::init (HANDLE, DWORD a, mode_t) if (a == (GENERIC_READ | GENERIC_WRITE)) mode = O_RDWR; - open (0, mode); + open (0, mode | O_NOCTTY); } int diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 414efcf..20c71f5 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -2987,8 +2987,7 @@ getwd (char *buf) } /* chdir: POSIX 5.2.1.1 */ -extern "C" -int +extern "C" int chdir (const char *in_dir) { int dir_error = check_null_empty_path (in_dir); diff --git a/winsup/cygwin/signal.cc b/winsup/cygwin/signal.cc index 714c31f..fcb82cd 100644 --- a/winsup/cygwin/signal.cc +++ b/winsup/cygwin/signal.cc @@ -160,7 +160,11 @@ kill_worker (pid_t pid, int sig) dest = myself_nowait_nonmain; #endif if (sig == 0) - res = proc_exists (dest) ? 0 : -1; + { + res = proc_exists (dest) ? 0 : -1; + if (res < 0) + set_errno (ESRCH); + } else if ((res = sig_send (dest, sig))) { sigproc_printf ("%d = sig_send, %E ", res); |