diff options
author | ajs <ajs> | 2005-02-17 20:07:22 +0000 |
---|---|---|
committer | ajs <ajs> | 2005-02-17 20:07:22 +0000 |
commit | 2ac9768bec315fb6cf9908f1fc4786144fab818c (patch) | |
tree | 8c118c70759a53d0c2bd7ef2b40cfe1ee28b08d8 | |
parent | 7bd4068f4a96e830a855aba9bfed118562f498fe (diff) | |
download | quagga-2ac9768bec315fb6cf9908f1fc4786144fab818c.tar.bz2 quagga-2ac9768bec315fb6cf9908f1fc4786144fab818c.tar.xz |
2005-02-17 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
* stream.c: (stream_read_try) Use new ERRNO_IO_RETRY macro.
-rw-r--r-- | lib/ChangeLog | 4 | ||||
-rw-r--r-- | lib/stream.c | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/ChangeLog b/lib/ChangeLog index 40e73ff7..c4054d00 100644 --- a/lib/ChangeLog +++ b/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. diff --git a/lib/stream.c b/lib/stream.c index 7e75f0da..a50835eb 100644 --- a/lib/stream.c +++ b/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 |