Sync with dev API
authorMikael Berthe <mikael@lilotux.net>
Sun, 27 Mar 2011 20:12:37 +0200
changeset 11 431de0cc8126
parent 10 36e7f4269583
child 12 b88ea7f650f1
Sync with dev API
uptime.c
--- a/uptime.c	Sun Nov 14 11:17:51 2010 +0100
+++ b/uptime.c	Sun Mar 27 20:12:37 2011 +0200
@@ -35,7 +35,7 @@
 
 module_info_t info_uptime_experimental = {
 	.branch      = "experimental",
-	.api         = 15,
+	.api         = 34,
 	.version     = PROJECT_VERSION,
 	.description = DESCRIPTION,
 	.requires    = NULL,
@@ -46,7 +46,7 @@
 
 module_info_t info_uptime = {
 	.branch      = "dev",
-	.api         = 13,
+	.api         = 20,
 	.version     = PROJECT_VERSION,
 	.description = DESCRIPTION,
 	.requires    = NULL,
@@ -55,6 +55,8 @@
 	.next        = &info_uptime_experimental,
 };
 
+static gpointer uptime_cmid = NULL;
+
 guint hz = 0;
 long long unsigned int mstime = 0;
 time_t starttime = 0;
@@ -227,13 +229,14 @@
 		}
 	}
 
-	cmd_add ("uptime", "", 0, 0, do_uptime, NULL);
+	uptime_cmid = cmd_add ("uptime", "", 0, 0, do_uptime, NULL);
 	return NULL;
 }
 
 void g_module_unload (GModule *module)
 {
-	cmd_del ("uptime");
+	if (uptime_cmid)
+		cmd_del (uptime_cmid);
 }
 
 /* The End */