diff options
author | ajs <ajs> | 2005-02-17 20:02:49 +0000 |
---|---|---|
committer | ajs <ajs> | 2005-02-17 20:02:49 +0000 |
commit | 7bd4068f4a96e830a855aba9bfed118562f498fe (patch) | |
tree | 290b3becbfcb1a01f40f2d1e15a9bc6b8ca7017c /lib/network.h | |
parent | af0c7e1e68965c88cb1f9eb10f499ba3b21ce7bd (diff) | |
download | quagga-7bd4068f4a96e830a855aba9bfed118562f498fe.tar.bz2 quagga-7bd4068f4a96e830a855aba9bfed118562f498fe.tar.xz |
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.
Diffstat (limited to 'lib/network.h')
-rw-r--r-- | lib/network.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/network.h b/lib/network.h index 589b80e9..9333ef81 100644 --- a/lib/network.h +++ b/lib/network.h @@ -33,4 +33,8 @@ int writen (int, const u_char *, int); -1 on error. */ extern int set_nonblocking(int fd); +/* Does the I/O error indicate that the operation should be retried later? */ +#define ERRNO_IO_RETRY(EN) \ + (((EN) == EAGAIN) || ((EN) == EWOULDBLOCK) || ((EN) == EINTR)) + #endif /* _ZEBRA_NETWORK_H */ |