]> granicus.if.org Git - pgbouncer/commitdiff
Proper stale pidfile handling in check_pidfile.
authorMarko Kreen <markokr@gmail.com>
Tue, 23 Feb 2016 09:20:43 +0000 (11:20 +0200)
committerMarko Kreen <markokr@gmail.com>
Tue, 23 Feb 2016 09:20:43 +0000 (11:20 +0200)
- Don't use remove_pidfile as that also frees value.
- Check for error, exit if failed.

src/main.c

index c3c6c97239cae9adb5ec14466284fbf6f81291d5..c948e52ae03826f49c2938e43798be5146423085 100644 (file)
@@ -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: