build: fix GCC 6 warning about EAGAIN and EWOULDBLOCK being equal
authorFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 15 Jun 2016 22:38:11 +0000 (00:38 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 15 Jun 2016 22:38:30 +0000 (00:38 +0200)
olsrd_info.c: In function ‘write_data’:
olsrd_info.c:374:48: error: logical ‘or’ of equal expressions [-Werror=logical-op]
     if ((result < 0) && ((errno == EWOULDBLOCK) || (errno == EAGAIN))) {
                                                ^~

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/info/olsrd_info.c
lib/quagga/src/client.c

index a38b106..0d5589e 100644 (file)
@@ -371,7 +371,11 @@ static void write_data(void *unused __attribute__((unused))) {
       outbuffer.written[i] += result;
     }
 
+#if EWOULDBLOCK == EAGAIN
+    if ((result < 0) && (errno == EAGAIN)) {
+#else
     if ((result < 0) && ((errno == EWOULDBLOCK) || (errno == EAGAIN))) {
+#endif
       continue;
     }
 
index 5ee0800..aac81b1 100644 (file)
@@ -200,7 +200,11 @@ zclient_read(ssize_t * size)
     /* handle no data available */
     if (bytes_received < 0) {
       /* handle disconnect */
+#if EWOULDBLOCK == EAGAIN
+      if (errno != EAGAIN) { // oops - we got disconnected
+#else
       if ((errno != EAGAIN) && (errno != EWOULDBLOCK)) { // oops - we got disconnected
+#endif
         OLSR_PRINTF(1, "(QUAGGA) Disconnected from zebra\n");
         zebra.status &= ~STATUS_CONNECTED;
         /* TODO: Remove HNAs added from redistribution */