]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tree-wide: no need to negate argument to ERROR_IS_XYZ()
authorLennart Poettering <lennart@poettering.net>
Fri, 28 Aug 2020 20:58:56 +0000 (22:58 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 28 Aug 2020 20:58:58 +0000 (22:58 +0200)
These macros call abs() internally, hence let's simplify invocations.

src/resolve/resolved-dns-transaction.c
src/tmpfiles/tmpfiles.c

index 016ff0136b6463234219bdfea281a08a3ffaf63b..6361397a080383f6c0a00b4c750fce656f150750 100644 (file)
@@ -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);
index 437b8bb4498a3df8fd2eb1d86b1a5b60249ed64e..f9b7c9040cdb7babd977ef3d202f19f0bc04fc2f 100644 (file)
@@ -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;