From 94e359738fc51b420c844b916c79080b1757f462 Mon Sep 17 00:00:00 2001 From: Chengwei Yang Date: Wed, 16 Jan 2013 10:40:26 +0800 Subject: [PATCH] Remove pid file at exit Change-Id: I60445a5156353552172c3374961fcf5af3917302 Signed-off-by: Chengwei Yang --- ss_main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ss_main.c b/ss_main.c index 4e8373a..ac7475c 100644 --- a/ss_main.c +++ b/ss_main.c @@ -35,8 +35,12 @@ #include "ss_device_plugin.h" #include "include/ss_data.h" +#define SS_PIDFILE_PATH "/var/run/.system_server.pid" + static void fini(struct ss_main_data *ad) { + // try to remove pid file + unlink(SS_PIDFILE_PATH); } static void init_ad(struct ss_main_data *ad) @@ -84,8 +88,6 @@ static void system_server_init(struct ss_main_data *ad) ss_bs_init(); } -#define SS_PIDFILE_PATH "/var/run/.system_server.pid" - static int system_main(int argc, char **argv) { struct ss_main_data ad; -- 2.7.4