summaryrefslogtreecommitdiff
path: root/src/basic/socket-util.c
diff options
context:
space:
mode:
authorAndreas Rammhold <andreas@rammhold.de>2017-09-29 00:37:23 +0200
committerSven Eden <yamakuzure@gmx.net>2017-09-29 00:37:23 +0200
commita4488a7509a96d8b9f0d7793517a217c70ac0361 (patch)
treeb7e4afb30d283f580ba35d37290bcf22a124a091 /src/basic/socket-util.c
parent471b87cc6c159bafd11023e009fc43aa73812b5f (diff)
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.
Diffstat (limited to 'src/basic/socket-util.c')
-rw-r--r--src/basic/socket-util.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/basic/socket-util.c b/src/basic/socket-util.c
index 5487d1b05..c32b8d3e1 100644
--- a/src/basic/socket-util.c
+++ b/src/basic/socket-util.c
@@ -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) {
@@ -1085,7 +1084,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;