Browse Source

2005-02-17 Andrew J. Schorr <ajschorr@alumni.princeton.edu>

	* stream.c: (stream_read_try) Use new ERRNO_IO_RETRY macro.
ajs 16 years ago
parent
commit
53270116df
2 changed files with 5 additions and 2 deletions
  1. 4 0
      lib/ChangeLog
  2. 1 2
      lib/stream.c

+ 4 - 0
lib/ChangeLog

@@ -1,5 +1,9 @@
 2005-02-17 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
 
+	* stream.c: (stream_read_try) Use new ERRNO_IO_RETRY macro.
+
+2005-02-17 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
+
 	* network.h: Define a new ERRNO_IO_RETRY macro to test whether an I/O
 	  operation should be retried.  This eliminates the need to duplicate
 	  the same logic testing for EAGAIN or EINTR in multiple places.

+ 1 - 2
lib/stream.c

@@ -624,8 +624,7 @@ stream_read_try(struct stream *s, int fd, size_t size)
       return nbytes;
     }
   /* Error: was it transient (return -2) or fatal (return -1)? */
-  return ((errno == EAGAIN) || (errno == EWOULDBLOCK) || (errno == EINTR)) ?
-         -2 : -1;
+  return ERRNO_IO_RETRY(errno) ? -2 : -1;
 }
 
 /* Read up to smaller of size or SIZE_REMAIN() bytes to the stream, starting