+ Check arguments of select-ports/port-channels
+ Fix typo in really-select-port-channels
This commit is contained in:
parent
923ada9986
commit
e47611a0ae
|
@ -949,7 +949,15 @@
|
|||
|
||||
(values n-read-ready n-write-ready 0)))))))))
|
||||
|
||||
(define (verify-select-port-arguments! proc lst)
|
||||
(for-each (lambda (p)
|
||||
(or (input-port? p)
|
||||
(output-port? p)
|
||||
(call-error "Argument not a port" proc p)))
|
||||
lst))
|
||||
|
||||
(define (select-ports timeout . ports)
|
||||
(verify-select-port-arguments! select-ports ports)
|
||||
(let ((read-list (filter input-port? ports))
|
||||
(write-list (filter output-port? ports)))
|
||||
|
||||
|
@ -969,6 +977,7 @@
|
|||
(really-select-port-channels timeout read-list write-list)))))
|
||||
|
||||
(define (select-port-channels timeout . ports)
|
||||
(verify-select-port-arguments! select-ports ports)
|
||||
(let ((read-list (filter input-port? ports))
|
||||
(write-list (filter output-port? ports)))
|
||||
|
||||
|
@ -1007,5 +1016,6 @@
|
|||
(filter (lambda (write-port)
|
||||
(any (lambda (write-channel)
|
||||
(eq? write-channel
|
||||
(port/fdes->output-channel write-port)))))
|
||||
(port/fdes->output-channel write-port)))
|
||||
ready-write-channels))
|
||||
write-list))))))
|
||||
|
|
Loading…
Reference in New Issue