guile-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

guile/guile-core/libguile ChangeLog ioext.c


From: Gary Houston
Subject: guile/guile-core/libguile ChangeLog ioext.c
Date: Thu, 18 Jan 2001 14:54:54 -0800

CVSROOT:        /cvs
Module name:    guile
Changes by:     Gary Houston <address@hidden>   01/01/18 14:54:54

Modified files:
        guile-core/libguile: ChangeLog ioext.c 

Log message:
        * ioext.c: further simplify scm_read_string_x_partial by defining
        a macro SCM_EBLOCK.

CVSWeb URLs:
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/libguile/ChangeLog.diff?r1=1.1237&r2=1.1238
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/libguile/ioext.c.diff?r1=1.75&r2=1.76

Patches:
Index: guile/guile-core/libguile/ChangeLog
diff -u guile/guile-core/libguile/ChangeLog:1.1237 
guile/guile-core/libguile/ChangeLog:1.1238
--- guile/guile-core/libguile/ChangeLog:1.1237  Thu Jan 18 07:12:51 2001
+++ guile/guile-core/libguile/ChangeLog Thu Jan 18 14:54:54 2001
@@ -1,3 +1,8 @@
+2001-01-18  Gary Houston  <address@hidden>
+
+       * ioext.c: further simplify scm_read_string_x_partial by defining
+       a macro SCM_EBLOCK.
+
 2001-01-18  Dirk Herrmann  <address@hidden>
 
        * gh_data.c (gh_ints2scm):  Simplified using SCM_FIXABLE.
Index: guile/guile-core/libguile/ioext.c
diff -u guile/guile-core/libguile/ioext.c:1.75 
guile/guile-core/libguile/ioext.c:1.76
--- guile/guile-core/libguile/ioext.c:1.75      Mon Jan  8 15:10:06 2001
+++ guile/guile-core/libguile/ioext.c   Thu Jan 18 14:54:54 2001
@@ -69,6 +69,22 @@
 #endif
 
 
+#if defined (EAGAIN)
+#define SCM_MAYBE_EAGAIN || errno == EAGAIN
+#else
+#define SCM_MAYBE_EAGAIN
+#endif
+
+#if defined (EWOULDBLOCK)
+#define SCM_MAYBE_EWOULDBLOCK || errno == EWOULDBLOCK
+#else
+#define SCM_MAYBE_EWOULDBLOCK
+#endif
+
+/* MAYBE there is EAGAIN way of defining this macro but now I EWOULDBLOCK.  */
+#define SCM_EBLOCK(errno) \
+   (0 SCM_MAYBE_EAGAIN SCM_MAYBE_EWOULDBLOCK)
+
 SCM_DEFINE (scm_read_string_x_partial, "read-string!/partial", 1, 3, 0,
            (SCM str, SCM port_or_fdes, SCM start, SCM end),
            "Read characters from an fport or file descriptor into a\n"
@@ -140,17 +156,9 @@
       SCM_SYSCALL (chars_read = read (fdes, dest, read_len));
       if (chars_read == -1)
        {
-#if defined (EWOULDBLOCK) || defined (EAGAIN)
-         if (
-#if defined (EWOULDBLOCK)
-             errno == EWOULDBLOCK
-#else
-             errno == EAGAIN
-#endif
-             )
+         if (SCM_EBLOCK (errno))
            chars_read = 0;
          else
-#endif
            SCM_SYSERROR;
         }
       else if (chars_read == 0)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]