From ee8d930568456a6fd3f4ea0117f900b957044209 Mon Sep 17 00:00:00 2001 From: Daniel Mack Date: Wed, 9 Dec 2015 10:24:27 +0100 Subject: [PATCH] resolved: llmnr, mdns: simplify error handling sd_event_add_io() returns the error directly and does not mess with errno. --- src/resolve/resolved-llmnr.c | 4 +--- src/resolve/resolved-mdns.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/resolve/resolved-llmnr.c b/src/resolve/resolved-llmnr.c index 6a7ff9d..ed754c3 100644 --- a/src/resolve/resolved-llmnr.c +++ b/src/resolve/resolved-llmnr.c @@ -461,10 +461,8 @@ int manager_llmnr_ipv6_tcp_fd(Manager *m) { } r = sd_event_add_io(m->event, &m->llmnr_ipv6_tcp_event_source, m->llmnr_ipv6_tcp_fd, EPOLLIN, on_llmnr_stream, m); - if (r < 0) { - r = -errno; + if (r < 0) goto fail; - } return m->llmnr_ipv6_tcp_fd; diff --git a/src/resolve/resolved-mdns.c b/src/resolve/resolved-mdns.c index 096a4b1..abe63d5 100644 --- a/src/resolve/resolved-mdns.c +++ b/src/resolve/resolved-mdns.c @@ -275,10 +275,8 @@ int manager_mdns_ipv6_fd(Manager *m) { } r = sd_event_add_io(m->event, &m->mdns_ipv6_event_source, m->mdns_ipv6_fd, EPOLLIN, on_mdns_packet, m); - if (r < 0) { - r = -errno; + if (r < 0) goto fail; - } return m->mdns_ipv6_fd; -- 2.7.4