;; 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))
'(() () ()))