]> gitweb.factorcode.org Git - factor.git/commitdiff
basis: Fix bootstrap to display unix signals instead of "Error in print-error!"
authorDoug Coleman <doug.coleman@gmail.com>
Fri, 27 Sep 2019 22:17:56 +0000 (17:17 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Fri, 27 Sep 2019 22:17:56 +0000 (17:17 -0500)
basis/bootstrap/stage2.factor
basis/debugger/unix/unix.factor
basis/io/backend/unix/unix.factor
basis/unix/signals/signals.factor

index 3ec202482745c14525492288846fa7382dff574e..b0fab89b45ec631dec4ab7647423fde5faa1efe7 100644 (file)
@@ -82,6 +82,7 @@ CONSTANT: default-components
         "stage2: deployment mode" print
     ] [
         "debugger" require
+        os unix? [ "debugger.unix" require ] when
         "listener" require
     ] if
 
index c82c45d7f3744f20d0d8d53a0c12a21f48335c18..1f27bc1dbb1dbe11f8c45cb7f3861c3a5d936d2a 100644 (file)
@@ -1,25 +1,9 @@
 ! Copyright (C) 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: debugger io kernel math prettyprint sequences system
-io.launcher.unix accessors strings ;
+USING: accessors debugger io kernel math prettyprint sequences
+system unix.signals ;
 IN: debugger.unix
 
-CONSTANT: signal-names
-{
-    "SIGHUP" "SIGINT" "SIGQUIT" "SIGILL" "SIGTRAP" "SIGABRT"
-    "SIGEMT" "SIGFPE" "SIGKILL" "SIGBUS" "SIGSEGV" "SIGSYS"
-    "SIGPIPE" "SIGALRM" "SIGTERM" "SIGURG" "SIGSTOP" "SIGTSIP"
-    "SIGCONT" "SIGCHLD" "SIGTTIN" "SIGTTOU" "SIGIO" "SIGXCPU"
-    "SIGXFSZ" "SIGVTALRM" "SIGPROF" "SIGWINCH" "SIGINFO"
-    "SIGUSR1" "SIGUSR2"
-}
-
-GENERIC: signal-name ( obj -- str/f )
-
-M: signal signal-name n>> signal-name ;
-
-M: integer signal-name ( n -- str/f ) 1 - signal-names ?nth ;
-
 : signal-name. ( n -- )
     signal-name [ " (" ")" surround write ] when* ;
 
index 2468c53e58addad7154f3ee3009e16dc27bcaab4..50739708f50a4c8ccfc5c2a3a9abf56d22478d78 100644 (file)
@@ -5,7 +5,7 @@ classes.struct combinators destructors destructors.private fry
 io.backend io.backend.unix.multiplexers io.buffers io.files
 io.ports io.timeouts kernel kernel.private libc locals make math
 namespaces sequences summary system threads unix unix.ffi
-unix.stat unix.types ;
+unix.signals unix.stat unix.types ;
 QUALIFIED: io
 IN: io.backend.unix
 
@@ -185,10 +185,6 @@ M: stdin cancel-operation
         size-read-fd <fd> init-fd <input-port> >>size
         data-read-fd <fd> >>data ;
 
-SYMBOL: dispatch-signal-hook
-
-dispatch-signal-hook [ [ drop ] ] initialize
-
 : signal-pipe-fd ( -- n )
     OBJ-SIGNAL-PIPE special-object ; inline
 
index c8d378b5976972d79be392ee00aca30bd3c7a015..ec94cb2245e81941d7345d94776c8699256868d3 100644 (file)
@@ -1,9 +1,30 @@
 ! Copyright (C) 2011 Joe Groff.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: assocs io.backend.unix kernel namespaces sequences
-threads ;
+USING: accessors assocs kernel math namespaces sequences threads ;
 IN: unix.signals
 
+CONSTANT: signal-names
+{
+    "SIGHUP" "SIGINT" "SIGQUIT" "SIGILL" "SIGTRAP" "SIGABRT"
+    "SIGEMT" "SIGFPE" "SIGKILL" "SIGBUS" "SIGSEGV" "SIGSYS"
+    "SIGPIPE" "SIGALRM" "SIGTERM" "SIGURG" "SIGSTOP" "SIGTSIP"
+    "SIGCONT" "SIGCHLD" "SIGTTIN" "SIGTTOU" "SIGIO" "SIGXCPU"
+    "SIGXFSZ" "SIGVTALRM" "SIGPROF" "SIGWINCH" "SIGINFO"
+    "SIGUSR1" "SIGUSR2"
+}
+
+TUPLE: signal n ;
+
+GENERIC: signal-name ( obj -- str/f )
+
+M: signal signal-name n>> signal-name ;
+
+M: integer signal-name ( n -- str/f ) 1 - signal-names ?nth ;
+
+SYMBOL: dispatch-signal-hook
+
+dispatch-signal-hook [ [ drop ] ] initialize
+
 <PRIVATE
 
 SYMBOL: signal-handlers