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. */
                                ^~
This commit is contained in:
Richard W.M. Jones
2016-01-28 12:37:33 +00:00
parent b1b15dc77d
commit b12f0a809f

View File

@@ -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;