From 125205875b0b7daf8ab919387924a98b83d918b7 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Sun, 24 Jun 2001 21:57:50 +0000 Subject: * exceptions.cc (interrupt_setup): Move actions from setup_handler to here. (setup_handler): Move actions after a successful interrupt to interrupt_setup. * fork.cc (vfork): Augment debugging output. * sigproc.cc (proc_subproc): Ditto. * spawn.cc (spawn_guts): Ditto. Correctly fill out progname when spawn NO_WAIT. Call signal handler when a signal arrives. * sigproc.h: Declare a function. --- winsup/cygwin/spawn.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'winsup/cygwin/spawn.cc') diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc index ccf9ed1f6..db2603e30 100644 --- a/winsup/cygwin/spawn.cc +++ b/winsup/cygwin/spawn.cc @@ -302,7 +302,7 @@ spawn_guts (HANDLE hToken, const char * prog_arg, const char *const *argv, return -1; } - syscall_printf ("spawn_guts (%.132s)", prog_arg); + syscall_printf ("spawn_guts (%d, %.132s)", mode, prog_arg); if (argv == NULL) { @@ -708,9 +708,9 @@ skip_arg_parsing: { /* These are both duplicated in the child code. We do this here, primarily for strace. */ - strcpy (myself->progname, real_path); strace.execing = 1; hExeced = pi.hProcess; + strcpy (myself->progname, real_path); } else { @@ -723,10 +723,10 @@ skip_arg_parsing: syscall_printf ("-1 = spawnve (), process table full"); return -1; } - child->progname[0] = '\0'; child->dwProcessId = pi.dwProcessId; child->hProcess = pi.hProcess; child.remember (); + strcpy (child->progname, real_path); /* Start the child running */ ResumeThread (pi.hThread); } @@ -761,7 +761,8 @@ skip_arg_parsing: break; case WAIT_OBJECT_0 + 1: sigproc_printf ("signal arrived"); - ResetEvent (signal_arrived); + // reset_signal_arrived (); + thisframe.call_signal_handler (); continue; case WAIT_OBJECT_0 + 2: if (mode == _P_OVERLAY) @@ -890,6 +891,7 @@ _spawnve (HANDLE hToken, int mode, const char *path, const char *const *argv, ret = spawn_guts (hToken, path, argv, envp, mode); if (vf && ret > 0) { + debug_printf ("longjmping due to vfork"); vf->pid = ret; longjmp (vf->j, 1); } -- cgit v1.2.3