tree-wide: use IN_SET where possible

In addition to the changes from #6933 this handles cases that could be
matched with the included cocci file.
This commit is contained in:
Andreas Rammhold
2017-10-02 13:09:54 +02:00
parent 01a65d4180
commit 3742095b27
58 changed files with 140 additions and 131 deletions
+2 -3
View File
@@ -364,8 +364,7 @@ bool socket_address_can_accept(const SocketAddress *a) {
assert(a);
return
a->type == SOCK_STREAM ||
a->type == SOCK_SEQPACKET;
IN_SET(a->type, SOCK_STREAM, SOCK_SEQPACKET);
}
bool socket_address_equal(const SocketAddress *a, const SocketAddress *b) {
@@ -1081,7 +1080,7 @@ ssize_t next_datagram_size_fd(int fd) {
l = recv(fd, NULL, 0, MSG_PEEK|MSG_TRUNC);
if (l < 0) {
if (errno == EOPNOTSUPP || errno == EFAULT)
if (IN_SET(errno, EOPNOTSUPP, EFAULT))
goto fallback;
return -errno;