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:
parent
05cc1b87a9
commit
c0b836e316
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user