summaryrefslogtreecommitdiff
path: root/libdaemon
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2016-02-23 13:16:55 +0100
committerZdenek Kabelac <zkabelac@redhat.com>2016-02-23 14:41:24 +0100
commitc0b836e316c20b8ed4325331cf33ef36815eb233 (patch)
tree3579be8b3ef4bd850a73dc31b5ac31653cef5dc4 /libdaemon
parent05cc1b87a952995c54ad99b8e9a0da9479bb56a5 (diff)
downloadlvm2-c0b836e316c20b8ed4325331cf33ef36815eb233.tar.gz
gcc: logical-op warning go away
Don't be too much inventive and shutdown gcc6 warning: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69602
Diffstat (limited to 'libdaemon')
-rw-r--r--libdaemon/client/daemon-io.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libdaemon/client/daemon-io.c b/libdaemon/client/daemon-io.c
index f072764a7..5419d4053 100644
--- a/libdaemon/client/daemon-io.c
+++ b/libdaemon/client/daemon-io.c
@@ -49,8 +49,9 @@ int buffer_read(int fd, struct buffer *buffer) {
} else if (result == 0) {
errno = ECONNRESET;
return 0; /* we should never encounter EOF here */
- } else if (result < 0 && ( errno == EAGAIN || errno == EWOULDBLOCK ||
- errno == EINTR || errno == EIO)) {
+ } else if (result < 0 && (errno == EAGAIN ||
+ (EWOULDBLOCK != EAGAIN && errno == EWOULDBLOCK) ||
+ errno == EINTR || errno == EIO)) {
fd_set in;
FD_ZERO(&in);
FD_SET(fd, &in);
@@ -78,8 +79,9 @@ int buffer_write(int fd, const struct buffer *buffer) {
result = write(fd, use->mem + written, use->used - written);
if (result > 0)
written += result;
- else if (result < 0 && ( errno == EAGAIN || errno == EWOULDBLOCK ||
- errno == EINTR || errno == EIO)) {
+ else if (result < 0 && (errno == EAGAIN ||
+ (EWOULDBLOCK != EAGAIN && errno == EWOULDBLOCK) ||
+ errno == EINTR || errno == EIO)) {
fd_set out;
FD_ZERO(&out);
FD_SET(fd, &out);