mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-24 02:03:54 +03:00
sd-bus: cleanup bus_close_fds()
The safe_close() already checks the fd and returns -1.
This commit is contained in:
parent
8d51633304
commit
0fd8d506f4
@ -73,13 +73,9 @@ static void bus_close_fds(sd_bus *b) {
|
|||||||
|
|
||||||
detach_io_events(b);
|
detach_io_events(b);
|
||||||
|
|
||||||
if (b->input_fd >= 0)
|
if (b->input_fd != b->output_fd)
|
||||||
safe_close(b->input_fd);
|
|
||||||
|
|
||||||
if (b->output_fd >= 0 && b->output_fd != b->input_fd)
|
|
||||||
safe_close(b->output_fd);
|
safe_close(b->output_fd);
|
||||||
|
b->output_fd = b->input_fd = safe_close(b->input_fd);
|
||||||
b->input_fd = b->output_fd = -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void bus_reset_queues(sd_bus *b) {
|
static void bus_reset_queues(sd_bus *b) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user