]> git.ipfire.org Git - thirdparty/kmod.git/commit
util: fix warning of equal values on logical OR
authorLucas De Marchi <lucas.demarchi@intel.com>
Wed, 10 Aug 2016 15:42:12 +0000 (12:42 -0300)
committerLucas De Marchi <lucas.demarchi@intel.com>
Wed, 10 Aug 2016 15:45:36 +0000 (12:45 -0300)
commita6ede6c7ad46b5e2b8eddddca5590c0b745b045a
treeb146cda66004e346e8665b8fe03bfbd066780597
parent53d3a99cccf08016eff0351884e7e86a658dffd6
util: fix warning of equal values on logical OR

shared/util.c: In function ‘read_str_safe’:
shared/util.c:211:24: warning: logical ‘or’ of equal expressions [-Wlogical-op]
    if (errno == EAGAIN || errno == EWOULDBLOCK ||
                        ^~
shared/util.c: In function ‘write_str_safe’:
shared/util.c:237:24: warning: logical ‘or’ of equal expressions [-Wlogical-op]
    if (errno == EAGAIN || errno == EWOULDBLOCK ||
                        ^~

This is because EAGAIN and EWOULDBLOCK have the same value. Prefer
EAGAIN, but add a static assert to catch if it's not the same in another
architecture.
shared/util.c
testsuite/test-testsuite.c