This fixes
Backtrace:
10 (apply-smob/1 #<catch-closure
7fca5dcad920>)
In ice-9/boot-9.scm:
705:2 9 (call-with-prompt _ _ #<procedure default-prompt-handler (k proc)>)
In ice-9/eval.scm:
619:8 8 (_ #(#(#<directory (guile-user)
7fca5d93f140>)))
In ice-9/boot-9.scm:
2312:4 7 (save-module-excursion _)
3832:12 6 (_)
In 8sync/actors.scm:
812:6 5 (run-hive #<<hive>
7fca5d977190> _ #:cleanup _ #:handle-signals _)
In ice-9/control.scm:
91:24 4 (call-with-escape-continuation _)
In 8sync/agenda.scm:
569:6 3 (run-agenda #<<agenda> queue: (() . #f) prompt-tag: ("prompt") read-port-map: #<hash-table 7fca5…> …)
470:7 2 (update-agenda-from-select! #<<agenda> queue: (() . #f) prompt-tag: ("prompt") read-port-map: #<h…>)
In ice-9/boot-9.scm:
829:9 1 (catch system-error #<procedure
7fca5bf1ab70 at 8sync/agenda.scm:471:9 ()> #<procedure
7fca5cd09…> …)
In unknown file:
0 (select (#<closed: file
7fca5b077380> #<input-output: socket 11>) (#<closed: file
7fca5b077380>) # …)
ERROR: In procedure select:
In procedure select: Wrong type argument in position 1: #<closed: file
7fca5b077380>
* 8sync/agenda.scm (update-agenda-from-select!): Catch everything.
;; TODO: support usecond wait time too
(match (get-wait-time)
((sec . usec)
- (catch 'system-error
+ (catch #t ; expect: wrong-type-arg (open port), system-error
(lambda ()
(select (hash-keys (agenda-read-port-map agenda))
(hash-keys (agenda-write-port-map agenda))
'()
sec usec))
(lambda (key . rest-args)
+ (unless (and (memq key '(system-error wrong-type-arg))
+ (match rest-args
+ (((or "select" "get-u8" "get-bytevector-n" "lookahead-u8"
+ "put-u8" "put-bytevector") arg ...) #t)
+ (_ #f)))
+ (apply throw key rest-args))
(match rest-args
((_ _ _ (EINTR))
'(() () ()))