git » nmdb » commit b9096d9

nmdb: Only unlink the pidfile if we were asked to write it

author Alberto Bertogli
2012-09-12 22:05:38 UTC
committer Alberto Bertogli
2012-09-12 23:35:23 UTC
parent 934fab2c9461c453da09731d2d81e8b408e24bbf

nmdb: Only unlink the pidfile if we were asked to write it

Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>

nmdb/main.c +2 -1

diff --git a/nmdb/main.c b/nmdb/main.c
index 02df38a..7f4596f 100644
--- a/nmdb/main.c
+++ b/nmdb/main.c
@@ -260,7 +260,8 @@ int main(int argc, char **argv)
 
 	cache_free(cd);
 
-	unlink(settings.pidfile);
+	if (settings.pidfile)
+		unlink(settings.pidfile);
 
 	free_settings();