From b12f0a809f7d1aef9215d25bda2f0a2fd955d0f8 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 28 Jan 2016 12:37:33 +0000 Subject: [PATCH] GCC 6: Avoid warning about logical OR of "equal" expressions. The warning (see below) is fairly useless. This modification to the code avoids it. inotify.c: In function 'do_inotify_read': inotify.c:219:32: error: logical 'or' of equal expressions [-Werror=logical-op] if (errno == EWOULDBLOCK || errno == EAGAIN) /* End of list. */ ^~ --- daemon/inotify.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/daemon/inotify.c b/daemon/inotify.c index 1d9f9b4dc..562365b34 100644 --- a/daemon/inotify.c +++ b/daemon/inotify.c @@ -216,7 +216,9 @@ do_inotify_read (void) r = read (inotify_fd, inotify_buf + inotify_posn, sizeof (inotify_buf) - inotify_posn); if (r == -1) { - if (errno == EWOULDBLOCK || errno == EAGAIN) /* End of list. */ + /* End of list? */ + if (errno == EWOULDBLOCK || + (EWOULDBLOCK != EAGAIN && errno == EAGAIN)) break; reply_with_perror ("read"); goto error;