From 95d2155aeb643c45dbb8c92a50f442f72b948d0b Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 28 Aug 2020 22:58:56 +0200 Subject: [PATCH] tree-wide: no need to negate argument to ERROR_IS_XYZ() These macros call abs() internally, hence let's simplify invocations. --- src/resolve/resolved-dns-transaction.c | 4 ++-- src/tmpfiles/tmpfiles.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/resolve/resolved-dns-transaction.c b/src/resolve/resolved-dns-transaction.c index 016ff0136b..6361397a08 100644 --- a/src/resolve/resolved-dns-transaction.c +++ b/src/resolve/resolved-dns-transaction.c @@ -1184,7 +1184,7 @@ static int on_dns_packet(sd_event_source *s, int fd, uint32_t revents, void *use assert(t->scope); r = manager_recv(t->scope->manager, fd, DNS_PROTOCOL_DNS, &p); - if (ERRNO_IS_DISCONNECT(-r)) { + if (ERRNO_IS_DISCONNECT(r)) { usec_t usec; /* UDP connection failures get reported via ICMP and then are possibly delivered to us on the @@ -1737,7 +1737,7 @@ int dns_transaction_go(DnsTransaction *t) { dns_transaction_complete(t, DNS_TRANSACTION_RR_TYPE_UNSUPPORTED); return 0; } - if (t->scope->protocol == DNS_PROTOCOL_LLMNR && ERRNO_IS_DISCONNECT(-r)) { + if (t->scope->protocol == DNS_PROTOCOL_LLMNR && ERRNO_IS_DISCONNECT(r)) { /* On LLMNR, if we cannot connect to a host via TCP when doing reverse lookups. This means we cannot * answer this request with this protocol. */ dns_transaction_complete(t, DNS_TRANSACTION_NOT_FOUND); diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c index 437b8bb449..f9b7c9040c 100644 --- a/src/tmpfiles/tmpfiles.c +++ b/src/tmpfiles/tmpfiles.c @@ -3402,7 +3402,7 @@ static int run(int argc, char *argv[]) { } } - if (ERRNO_IS_RESOURCE(-r)) + if (ERRNO_IS_RESOURCE(r)) return r; if (invalid_config) return EX_DATAERR;