Remove pid file at exit
authorChengwei Yang <chengwei.yang@intel.com>
Wed, 16 Jan 2013 02:40:26 +0000 (10:40 +0800)
committerChengwei Yang <chengwei.yang@intel.com>
Wed, 16 Jan 2013 02:47:39 +0000 (10:47 +0800)
Change-Id: I60445a5156353552172c3374961fcf5af3917302
Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
ss_main.c

index 4e8373a..ac7475c 100644 (file)
--- a/ss_main.c
+++ b/ss_main.c
 #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;