1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

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
This commit is contained in:
Zdenek Kabelac 2016-02-23 13:16:55 +01:00
parent 05cc1b87a9
commit c0b836e316
2 changed files with 8 additions and 6 deletions

View File

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

View File

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