From f12633e73b8b51a6c46ddeaf6268525a92ba09f7 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sun, 24 Mar 2013 12:37:16 -0700 Subject: [PATCH] io.launcher.unix, unix.ffi: Reset ignored signal in process launcher. Fix SIG_DFL etc. --- basis/io/launcher/unix/unix.factor | 5 +++++ basis/unix/ffi/ffi.factor | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/basis/io/launcher/unix/unix.factor b/basis/io/launcher/unix/unix.factor index 7c3264f6be..3c56dd0c27 100644 --- a/basis/io/launcher/unix/unix.factor +++ b/basis/io/launcher/unix/unix.factor @@ -75,7 +75,12 @@ IN: io.launcher.unix dup get-environment set-os-envs ] when ; +! Ignored signals are not reset to the default handler. +: reset-ignored-signals ( process -- process ) + SIGPIPE SIG_DFL signal drop ; + : spawn-process ( process -- * ) + [ reset-ignored-signals ] [ 2drop 248 _exit ] recover [ setup-process-group ] [ 2drop 249 _exit ] recover [ setup-priority ] [ 2drop 250 _exit ] recover [ setup-redirection ] [ 2drop 251 _exit ] recover diff --git a/basis/unix/ffi/ffi.factor b/basis/unix/ffi/ffi.factor index 0c78e3ed32..512a913b41 100644 --- a/basis/unix/ffi/ffi.factor +++ b/basis/unix/ffi/ffi.factor @@ -39,9 +39,9 @@ CONSTANT: DT_LNK 10 CONSTANT: DT_SOCK 12 CONSTANT: DT_WHT 14 -: SIG_EFF ( -- obj ) -1 void* ; inline -: SIG_DFL ( -- obj ) 0 void* ; inline -: SIG_IGN ( -- obj ) 1 void* ; inline +: SIG_EFF ( -- obj ) ALIEN: -1 void* ; inline +: SIG_DFL ( -- obj ) ALIEN: 0 void* ; inline +: SIG_IGN ( -- obj ) ALIEN: 1 void* ; inline LIBRARY: libc