From: sos AT prospect DOT com DOT ru (Sergey Okhapkin) Subject: system() fix. 15 Jun 1998 06:04:37 -0700 Message-ID: <01BD987B.B1F2F150.cygnus.cygwin32.developers@sos> To: "'cygwin32-developers AT cygnus DOT com'" syscalls.cc: (system): ignore SIGINT, SIGQUIT and SIGCHLD while in a system() call. e:\usr\src\cygnus\cdk\winsup>diff -up syscalls.cc.orig syscalls.cc --- syscalls.cc.orig Sun Jun 07 14:10:53 1998 +++ syscalls.cc Mon Jun 15 16:27:24 1998 @@ -1335,10 +1335,14 @@ system (const char *cmdstring) { int res; const char* command[4]; + _sig_func_ptr oldint, oldquit, oldchld; if (cmdstring == (const char *) NULL) return 1; + oldint = signal (SIGINT, SIG_IGN); + oldquit = signal (SIGQUIT, SIG_IGN); + oldchld = signal (SIGCHLD, SIG_IGN); command[0] = "sh"; command[1] = "-c"; command[2] = cmdstring; @@ -1351,6 +1355,9 @@ system (const char *cmdstring) res = 127; } + signal (SIGINT, oldint); + signal (SIGQUIT, oldquit); + signal (SIGCHLD, oldchld); return res; } -- Sergey Okhapkin, http://www.lexa.ru/sos Moscow, Russia