diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2016-02-23 13:16:55 +0100 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2016-02-23 14:41:24 +0100 |
commit | c0b836e316c20b8ed4325331cf33ef36815eb233 (patch) | |
tree | 3579be8b3ef4bd850a73dc31b5ac31653cef5dc4 | |
parent | 05cc1b87a952995c54ad99b8e9a0da9479bb56a5 (diff) | |
download | lvm2-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
-rw-r--r-- | lib/device/dev-md.c | 4 | ||||
-rw-r--r-- | libdaemon/client/daemon-io.c | 10 |
2 files changed, 8 insertions, 6 deletions
diff --git a/lib/device/dev-md.c b/lib/device/dev-md.c index b6ee59fc0..3dbe831ca 100644 --- a/lib/device/dev-md.c +++ b/lib/device/dev-md.c @@ -38,8 +38,8 @@ static int _dev_has_md_magic(struct device *dev, uint64_t sb_offset) /* Version 1 is little endian; version 0.90.0 is machine endian */ if (dev_read(dev, sb_offset, sizeof(uint32_t), &md_magic) && - ((md_magic == xlate32(MD_SB_MAGIC)) || - (md_magic == MD_SB_MAGIC))) + ((md_magic == MD_SB_MAGIC) || + ((MD_SB_MAGIC != xlate32(MD_SB_MAGIC)) && (md_magic == xlate32(MD_SB_MAGIC))))) return 1; return 0; 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); |