]> gitweb.factorcode.org Git - factor.git/commitdiff
io.launcher.unix, unix.ffi: Reset ignored signal in process launcher. Fix SIG_DFL...
authorDoug Coleman <doug.coleman@gmail.com>
Sun, 24 Mar 2013 19:37:16 +0000 (12:37 -0700)
committerDoug Coleman <doug.coleman@gmail.com>
Sun, 24 Mar 2013 19:38:02 +0000 (12:38 -0700)
basis/io/launcher/unix/unix.factor
basis/unix/ffi/ffi.factor

index 7c3264f6bebdd7e8f074b4d51af2b3cc37a1dff1..3c56dd0c272b8333cfcb1ae1ce1c21a9d8b275cc 100644 (file)
@@ -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
index 0c78e3ed328e6204e8e36ef0d2bafac754cba50c..512a913b41995e8d3fd058072a09f6dc9fd23324 100644 (file)
@@ -39,9 +39,9 @@ CONSTANT: DT_LNK      10
 CONSTANT: DT_SOCK     12
 CONSTANT: DT_WHT      14
 
-: SIG_EFF ( -- obj ) -1 void* <ref> ; inline
-: SIG_DFL ( -- obj ) 0 void* <ref> ; inline
-: SIG_IGN ( -- obj ) 1 void* <ref> ; inline
+: SIG_EFF ( -- obj ) ALIEN: -1 void* <ref> ; inline
+: SIG_DFL ( -- obj ) ALIEN: 0 void* <ref> ; inline
+: SIG_IGN ( -- obj ) ALIEN: 1 void* <ref> ; inline
 
 LIBRARY: libc