diff options
author | Andreas Rammhold <andreas@rammhold.de> | 2017-09-29 09:58:22 +0200 |
---|---|---|
committer | Andreas Rammhold <andreas@rammhold.de> | 2017-10-02 13:09:56 +0200 |
commit | ec2ce0c5d7623c83dabf50c98253f5b0c0fb1359 (patch) | |
tree | 2be64c5b07a1c2cde8c2244a78b5e4c5e125e4b9 /src/resolve | |
parent | tree-wide: use IN_SET where possible (diff) | |
download | systemd-ec2ce0c5d7623c83dabf50c98253f5b0c0fb1359.tar.xz systemd-ec2ce0c5d7623c83dabf50c98253f5b0c0fb1359.zip |
tree-wide: use `!IN_SET(..)` for `a != b && a != c && …`
The included cocci was used to generate the changes.
Thanks to @flo-wer for pointing this case out.
Diffstat (limited to 'src/resolve')
-rw-r--r-- | src/resolve/resolved-dns-stream.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/resolve/resolved-dns-stream.c b/src/resolve/resolved-dns-stream.c index 878bae47dc..4a94fa9916 100644 --- a/src/resolve/resolved-dns-stream.c +++ b/src/resolve/resolved-dns-stream.c @@ -221,7 +221,7 @@ static int on_stream_io(sd_event_source *es, int fd, uint32_t revents, void *use ss = writev(fd, iov, 2); if (ss < 0) { - if (errno != EINTR && errno != EAGAIN) + if (!IN_SET(errno, EINTR, EAGAIN)) return dns_stream_complete(s, errno); } else s->n_written += ss; @@ -243,7 +243,7 @@ static int on_stream_io(sd_event_source *es, int fd, uint32_t revents, void *use ss = read(fd, (uint8_t*) &s->read_size + s->n_read, sizeof(s->read_size) - s->n_read); if (ss < 0) { - if (errno != EINTR && errno != EAGAIN) + if (!IN_SET(errno, EINTR, EAGAIN)) return dns_stream_complete(s, errno); } else if (ss == 0) return dns_stream_complete(s, ECONNRESET); @@ -293,7 +293,7 @@ static int on_stream_io(sd_event_source *es, int fd, uint32_t revents, void *use (uint8_t*) DNS_PACKET_DATA(s->read_packet) + s->n_read - sizeof(s->read_size), sizeof(s->read_size) + be16toh(s->read_size) - s->n_read); if (ss < 0) { - if (errno != EINTR && errno != EAGAIN) + if (!IN_SET(errno, EINTR, EAGAIN)) return dns_stream_complete(s, errno); } else if (ss == 0) return dns_stream_complete(s, ECONNRESET); |