diff src/config/main.c @ 9348:0c587f108916 HEAD

lib-master has now a global master_service variable that all binaries use. There should always be only one of them anyway.
author Timo Sirainen <tss@iki.fi>
date Fri, 22 May 2009 17:26:27 -0400
parents 39c2db5f1fcc
children d7ccdbb58a03
line wrap: on
line diff
--- a/src/config/main.c	Fri May 22 13:07:17 2009 -0400
+++ b/src/config/main.c	Fri May 22 17:26:27 2009 -0400
@@ -11,8 +11,6 @@
 #include <stdlib.h>
 #include <unistd.h>
 
-static struct master_service *service;
-
 static void client_connected(const struct master_service_connection *conn)
 {
 	config_connection_create(conn->fd);
@@ -22,18 +20,18 @@
 {
 	int c;
 
-	service = master_service_init("config", 0, argc, argv);
+	master_service = master_service_init("config", 0, argc, argv);
 	while ((c = getopt(argc, argv, master_service_getopt_string())) > 0) {
-		if (!master_service_parse_option(service, c, optarg))
+		if (!master_service_parse_option(master_service, c, optarg))
 			exit(FATAL_DEFAULT);
 	}
 
-	master_service_init_log(service, "config: ", 0);
-	master_service_init_finish(service);
-	config_parse_file(master_service_get_config_path(service), TRUE);
+	master_service_init_log(master_service, "config: ", 0);
+	master_service_init_finish(master_service);
+	config_parse_file(master_service_get_config_path(master_service), TRUE);
 
-	master_service_run(service, client_connected);
+	master_service_run(master_service, client_connected);
 	config_connections_destroy_all();
-	master_service_deinit(&service);
+	master_service_deinit(&master_service);
         return 0;
 }