From: Marko Kreen Date: Tue, 23 Feb 2016 09:20:43 +0000 (+0200) Subject: Proper stale pidfile handling in check_pidfile. X-Git-Tag: pgbouncer_1_7_2~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=106dc7b79e4acde8bc24016da226060901708d3f;p=pgbouncer Proper stale pidfile handling in check_pidfile. - Don't use remove_pidfile as that also frees value. - Check for error, exit if failed. --- diff --git a/src/main.c b/src/main.c index c3c6c97..c948e52 100644 --- a/src/main.c +++ b/src/main.c @@ -603,7 +603,9 @@ static void check_pidfile(void) /* seems the pidfile is not in use */ log_info("Stale pidfile, removing"); - remove_pidfile(); + err = unlink(cf_pidfile); + if (err != 0) + fatal_perror("Cannot remove stale pidfile"); return; locked_pidfile: