diff options
author | Namhyung Kim <namhyung@gmail.com> | 2015-08-02 00:35:22 +0900 |
---|---|---|
committer | Namhyung Kim <namhyung@gmail.com> | 2015-08-02 23:12:08 +0900 |
commit | 0fd8d506f4c41cb5b43649adde154353198d1ea8 (patch) | |
tree | bba02aea782cf4fd9c0fe0fe6aa3b5237fb47fc6 /src/libsystemd | |
parent | 8d51633304cc460eddf617d9404da7f4f9fadd73 (diff) |
sd-bus: cleanup bus_close_fds()
The safe_close() already checks the fd and returns -1.
Diffstat (limited to 'src/libsystemd')
-rw-r--r-- | src/libsystemd/sd-bus/sd-bus.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c index 767df40e81..b9e93f6f41 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) { |