diff options
author | Steve Bennett <steveb@workware.net.au> | 2019-08-21 11:18:00 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2019-09-06 20:08:31 +1000 |
commit | 4dc539a582764fc4ae6788fc3f1dc0e6e7cd95d4 (patch) | |
tree | c915f71250a4dd85dd00dea8fe32cbdbbbe5eade /jim-exec.c | |
parent | 4fd87e892eeb9bcb050e3f5bc3b5b5f92dc0f6aa (diff) | |
download | jimtcl-4dc539a582764fc4ae6788fc3f1dc0e6e7cd95d4.zip jimtcl-4dc539a582764fc4ae6788fc3f1dc0e6e7cd95d4.tar.gz jimtcl-4dc539a582764fc4ae6788fc3f1dc0e6e7cd95d4.tar.bz2 |
exec: Don't force SIGPIPE to be enabled
Previously SIGPIPE was set to SIG_DFL before vfork so that child processes
always had SIGPIPE enabled. This makes it impossible to disable SIGPIPE for
child processes. So don't do this. Instead allow the disposition of SIGPIPE
to be handled by the 'signal' command.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'jim-exec.c')
-rw-r--r-- | jim-exec.c | 17 |
1 files changed, 0 insertions, 17 deletions
@@ -1079,9 +1079,6 @@ badargs: close(lastOutputId); } - /* Restore SIGPIPE behaviour */ - (void)signal(SIGPIPE, SIG_DFL); - execvpe(arg_array[firstArg], &arg_array[firstArg], child_environ); if (write(fileno(stderr), "couldn't exec \"", 15) && @@ -1239,20 +1236,6 @@ int Jim_execInit(Jim_Interp *interp) if (Jim_PackageProvide(interp, "exec", "1.0", JIM_ERRMSG)) return JIM_ERR; -#ifdef SIGPIPE - /* - * Disable SIGPIPE signals: if they were allowed, this process - * might go away unexpectedly if children misbehave. This code - * can potentially interfere with other application code that - * expects to handle SIGPIPEs. - * - * By doing this in the init function, applications can override - * this later. Note that child processes have SIGPIPE restored - * to the default after vfork(). - */ - (void)signal(SIGPIPE, SIG_IGN); -#endif - waitinfo = JimAllocWaitInfoTable(); Jim_CreateCommand(interp, "exec", Jim_ExecCmd, waitinfo, JimFreeWaitInfoTable); waitinfo->refcount++; |