diff options
author | Thomas Hindoe Paaboel Andersen <phomes@gmail.com> | 2014-03-01 22:52:25 +0100 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2014-03-01 23:16:55 +0100 |
commit | e1528e085cefce20e93d930a45fce792e32db29a (patch) | |
tree | 039f48e1894c3a77e6b97d7262b4b1b1cfbf837e /src/network/networkd-wait-online.c | |
parent | abdab4f602745952030a37b1521cd0374d51d3ea (diff) |
networkd-wait-online: use automatic cleanup
Diffstat (limited to 'src/network/networkd-wait-online.c')
-rw-r--r-- | src/network/networkd-wait-online.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/network/networkd-wait-online.c b/src/network/networkd-wait-online.c index 51c6bbd495..50b753b4f0 100644 --- a/src/network/networkd-wait-online.c +++ b/src/network/networkd-wait-online.c @@ -20,8 +20,10 @@ ***/ #include "sd-event.h" +#include "event-util.h" #include "sd-daemon.h" #include "sd-network.h" +#include "network-util.h" #include "util.h" @@ -62,9 +64,9 @@ static int event_handler(sd_event_source *s, int fd, uint32_t revents, } int main(int argc, char *argv[]) { - sd_event *event; - sd_event_source *event_source; - sd_network_monitor *monitor; + _cleanup_event_unref_ sd_event *event = NULL; + _cleanup_event_source_unref_ sd_event_source *event_source = NULL; + _cleanup_network_monitor_unref_ sd_network_monitor *monitor = NULL; int r, fd, events; log_set_target(LOG_TARGET_AUTO); @@ -129,9 +131,5 @@ out: sd_notify(false, "STATUS=All interfaces configured..."); - sd_event_source_unref(event_source); - sd_event_unref(event); - sd_network_monitor_unref(monitor); - return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS; } |