diff options
author | Gary Houston <ghouston@arglist.com> | 2000-03-31 19:23:52 +0000 |
---|---|---|
committer | Gary Houston <ghouston@arglist.com> | 2000-03-31 19:23:52 +0000 |
commit | 8cc58ec1cc63c067db8b369c8f069e7e929cfd38 (patch) | |
tree | 858c000f0a8b5c029634452f4f278dd48d9b71a4 | |
parent | cffcab301343a983560c113fdf34af26315d2fe2 (diff) | |
download | guile-8cc58ec1cc63c067db8b369c8f069e7e929cfd38.tar.gz |
* tests/ports.test (non-blocking-I/O): a couple more details:
a) combine the O_NONBLOCK flag with the default flags instead
of replacing them. b) check EWOULDBLOCK as well as EAGAIN.
-rw-r--r-- | test-suite/tests/ports.test | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/test-suite/tests/ports.test b/test-suite/tests/ports.test index 5c508a9ab..6a4357f99 100644 --- a/test-suite/tests/ports.test +++ b/test-suite/tests/ports.test @@ -195,18 +195,20 @@ (string=? (read-line) "moon"))))) ;;; non-blocking mode on a port. create a pipe and set O_NONBLOCK on -;;; the reading end. try to read a byte: should get EAGAIN error. +;;; the reading end. try to read a byte: should get EAGAIN or +;;; EWOULDBLOCK error. (catch-test-errors (let* ((p (pipe)) (r (car p))) - (fcntl r F_SETFL O_NONBLOCK) + (fcntl r F_SETFL (logior (fcntl r F_GETFL) O_NONBLOCK)) (pass-if "non-blocking-I/O" (catch 'system-error (lambda () (read-char r) #f) (lambda (key . args) (and (eq? key 'system-error) - (= (car (list-ref args 3)) EAGAIN))))))) - + (let ((errno (car (list-ref args 3)))) + (or (= errno EAGAIN) + (= errno EWOULDBLOCK))))))))) ;;;; Pipe (popen) ports. |