Default sighandler for SIG/INT depends on whether we run interactive or not.
This commit is contained in:
parent
145ddac9cb
commit
b3447ad964
|
@ -332,7 +332,7 @@
|
||||||
|
|
||||||
(define-foreign %%get-int-handlers (get_int_handlers) desc)
|
(define-foreign %%get-int-handlers (get_int_handlers) desc)
|
||||||
|
|
||||||
(define (%install-scsh-handlers)
|
(define (%install-scsh-handlers interactive?)
|
||||||
(do ((int 0 (+ int 1)))
|
(do ((int 0 (+ int 1)))
|
||||||
((= int number-of-interrupts))
|
((= int number-of-interrupts))
|
||||||
(set-interrupt-handler
|
(set-interrupt-handler
|
||||||
|
@ -342,7 +342,7 @@
|
||||||
((< sig 0))
|
((< sig 0))
|
||||||
(let ((i (%signal->interrupt sig)))
|
(let ((i (%signal->interrupt sig)))
|
||||||
(if (not (or (= i -1)
|
(if (not (or (= i -1)
|
||||||
(= sig signal/int) ; Leave ^c and
|
; (= sig signal/int) ; Leave ^c and
|
||||||
(= sig signal/alrm))) ; alarm handlers alone.
|
(= sig signal/alrm))) ; alarm handlers alone.
|
||||||
(set-interrupt-handler
|
(set-interrupt-handler
|
||||||
i
|
i
|
||||||
|
@ -353,6 +353,9 @@
|
||||||
(error "sighandler did not find scheduler-initial-thread, but"
|
(error "sighandler did not find scheduler-initial-thread, but"
|
||||||
scheduler-initial-thread))
|
scheduler-initial-thread))
|
||||||
|
|
||||||
|
;; Note: this will prevent any other system to work, since it pushes
|
||||||
|
;; a new command level !
|
||||||
|
(if interactive?
|
||||||
(set-interrupt-handler interrupt/keyboard
|
(set-interrupt-handler interrupt/keyboard
|
||||||
(lambda stuff
|
(lambda stuff
|
||||||
((structure-ref threads-internal schedule-event)
|
((structure-ref threads-internal schedule-event)
|
||||||
|
@ -360,7 +363,7 @@
|
||||||
(enum
|
(enum
|
||||||
(structure-ref threads-internal event-type)
|
(structure-ref threads-internal event-type)
|
||||||
interrupt)
|
interrupt)
|
||||||
(enum interrupt keyboard))))))
|
(enum interrupt keyboard)))))))
|
||||||
|
|
||||||
;;; I am ashamed to say the 33 below is completely bogus.
|
;;; I am ashamed to say the 33 below is completely bogus.
|
||||||
;;; What we want is a value that is 1 + max interrupt value.
|
;;; What we want is a value that is 1 + max interrupt value.
|
||||||
|
|
|
@ -47,6 +47,8 @@
|
||||||
(init-low-interrupt)
|
(init-low-interrupt)
|
||||||
(install-event-handlers!)
|
(install-event-handlers!)
|
||||||
(install-env)
|
(install-env)
|
||||||
|
(%install-scsh-handlers #f)
|
||||||
|
(install-autoreaping)
|
||||||
(init-scsh-vars #f) ; Do it quietly.
|
(init-scsh-vars #f) ; Do it quietly.
|
||||||
(start args))
|
(start args))
|
||||||
filename))
|
filename))
|
||||||
|
|
|
@ -240,7 +240,7 @@
|
||||||
(spawn forever-sleeping-thread)
|
(spawn forever-sleeping-thread)
|
||||||
(init-low-interrupt)
|
(init-low-interrupt)
|
||||||
(install-event-handlers!)
|
(install-event-handlers!)
|
||||||
(%install-scsh-handlers)
|
(%install-scsh-handlers (not term-switch))
|
||||||
(install-autoreaping)
|
(install-autoreaping)
|
||||||
(install-env)
|
(install-env)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue