]> git.proxmox.com Git - mirror_frr.git/commitdiff
2005-02-17 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
authorajs <ajs>
Thu, 17 Feb 2005 20:02:49 +0000 (20:02 +0000)
committerajs <ajs>
Thu, 17 Feb 2005 20:02:49 +0000 (20:02 +0000)
* 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.

lib/ChangeLog
lib/network.h

index ac05baba280e372bbde8994feddee067e09ac958..40e73ff7b8df21ea4c8df208b8e695ff085f8b58 100644 (file)
@@ -1,3 +1,9 @@
+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.
+
 2005-02-16 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
 
        * stream.h: Declare new function stream_read_try suitable for use
index 589b80e9c17a71ad80bc152aff9325814a9d6407..9333ef81d54ef4b6a39dd304e806c93427c36d69 100644 (file)
@@ -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 */