* 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.
This commit is contained in:
Christopher Faylor 2001-06-16 17:09:19 +00:00
parent 947ab99ee9
commit 99a5bd2fab
6 changed files with 25 additions and 8 deletions

View File

@ -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.

View File

@ -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

View File

@ -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 ())

View File

@ -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

View File

@ -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);

View File

@ -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);