From: Namhyung Kim Date: Sat, 1 Aug 2015 15:35:22 +0000 (+0900) Subject: sd-bus: cleanup bus_close_fds() X-Git-Tag: v225~130^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0fd8d506f4c41cb5b43649adde154353198d1ea8;p=thirdparty%2Fsystemd.git sd-bus: cleanup bus_close_fds() The safe_close() already checks the fd and returns -1. --- diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c index 767df40e81a..b9e93f6f41e 100644 --- a/src/libsystemd/sd-bus/sd-bus.c +++ b/src/libsystemd/sd-bus/sd-bus.c @@ -73,13 +73,9 @@ static void bus_close_fds(sd_bus *b) { detach_io_events(b); - if (b->input_fd >= 0) - safe_close(b->input_fd); - - if (b->output_fd >= 0 && b->output_fd != b->input_fd) + if (b->input_fd != b->output_fd) safe_close(b->output_fd); - - b->input_fd = b->output_fd = -1; + b->output_fd = b->input_fd = safe_close(b->input_fd); } static void bus_reset_queues(sd_bus *b) {