From a464c06bfdc4305d471c5084a825b041628d1ee7 Mon Sep 17 00:00:00 2001 From: slava Date: Wed, 19 Jul 2006 21:15:13 +0000 Subject: [PATCH] OS X 10.3 workaround --- library/io/unix/io.factor | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/library/io/unix/io.factor b/library/io/unix/io.factor index 599f967ca5..2f12c802da 100644 --- a/library/io/unix/io.factor +++ b/library/io/unix/io.factor @@ -41,7 +41,12 @@ SYMBOL: write-tasks : io-error ( n -- ) 0 < [ (io-error) ] when ; -: init-handle ( fd -- ) F_SETFL O_NONBLOCK fcntl io-error ; +: init-handle ( fd -- ) + #! We drop the error code rather than calling io-error, + #! since on OS X 10.3, this operation fails from init-io + #! when running the Factor.app (presumably because fd 0 and + #! 1 are closed). + F_SETFL O_NONBLOCK fcntl drop ; ! Common delegate of native stream readers and writers SYMBOL: input