[前][次][番号順一覧][スレッド一覧]

ruby-changes:6848

From: nobu <ko1@a...>
Date: Tue, 5 Aug 2008 12:44:22 +0900 (JST)
Subject: [ruby-changes:6848] Ruby:r18364 (trunk): * io.c (retry_sendfile, retry_read): ENOSYS and EWOULDBLOCK are not

nobu	2008-08-05 12:44:09 +0900 (Tue, 05 Aug 2008)

  New Revision: 18364

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=18364

  Log:
    * io.c (retry_sendfile, retry_read): ENOSYS and EWOULDBLOCK are not
      defined on every platforms.

  Modified files:
    trunk/ChangeLog
    trunk/io.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 18363)
+++ ChangeLog	(revision 18364)
@@ -1,3 +1,8 @@
+Tue Aug  5 12:43:47 2008  Nobuyoshi Nakada  <nobu@r...>
+
+	* io.c (retry_sendfile, retry_read): ENOSYS and EWOULDBLOCK are not
+	  defined on every platforms.
+
 Tue Aug  5 12:34:49 2008  Nobuyoshi Nakada  <nobu@r...>
 
 	* transcode_data.h (TRANSCODE_ERROR): common transcode failure
Index: io.c
===================================================================
--- io.c	(revision 18363)
+++ io.c	(revision 18364)
@@ -6590,9 +6590,16 @@
         }
     }
     if (ss == -1) {
-        if (errno == EINVAL || errno == ENOSYS)
+        switch (errno) {
+	  case EINVAL:
+#ifdef ENOSYS
+	  case ENOSYS:
+#endif
             return 0;
-        if (errno == EAGAIN || errno == EWOULDBLOCK) {
+	  case EAGAIN:
+#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
+	  case EWOULDBLOCK:
+#endif
             if (copy_stream_wait_write(stp) == -1)
                 return -1;
             if (RUBY_VM_INTERRUPTED(stp->th))
@@ -6626,12 +6633,17 @@
         return 0;
     }
     if (ss == -1) {
-        if (errno == EAGAIN || errno == EWOULDBLOCK) {
+        switch (errno) {
+	  case EAGAIN:
+#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
+	  case EWOULDBLOCK:
+#endif
             if (copy_stream_wait_read(stp) == -1)
                 return -1;
             goto retry_read;
-        }
-        if (errno == ENOSYS) {
+#ifdef ENOSYS
+	  case ENOSYS:
+#endif
             stp->notimp = "pread";
             return -1;
         }

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]