summaryrefslogtreecommitdiffstats
path: root/network/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'network/main.c')
-rw-r--r--network/main.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/network/main.c b/network/main.c
index 5e8f2739..d0daf429 100644
--- a/network/main.c
+++ b/network/main.c
@@ -66,15 +66,17 @@ int main(int argc, char *argv[])
/* Create event loop */
main_loop = g_main_loop_new(NULL, FALSE);
+ if (network_init() == -1)
+ goto fail;
+
if (argc > 1 && !strcmp(argv[1], "-s"))
internal_service("network");
- network_init();
-
g_main_loop_run(main_loop);
network_exit();
+fail:
g_main_loop_unref(main_loop);
info("Exit");