From: Harlan Stenn Date: Mon, 23 Dec 2013 08:03:25 +0000 (-0500) Subject: [Bug 2513] Remove any PIDFILE in finish() X-Git-Tag: NTP_4_2_7P403~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4ed90d9ae701f061a376582bca0bf1eecb505e7a;p=thirdparty%2Fntp.git [Bug 2513] Remove any PIDFILE in finish() bk: 52b7ee4d1W6Y-NABGyHfqcKoh8_8ow --- diff --git a/ChangeLog b/ChangeLog index 9c3acc75f..3ad3dd669 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,4 @@ +* [Bug 2513] Remove any PIDFILE in finish(). * [Bug 2516] Enable clock_gettime() support for AIX 5+. * [Bug 2517] Fix peer status errors in decode.html. (4.2.7p402) 2013/12/23 Released by Harlan Stenn diff --git a/ntpd/ntpd.c b/ntpd/ntpd.c index 49a9cbf3f..19e8db750 100644 --- a/ntpd/ntpd.c +++ b/ntpd/ntpd.c @@ -1143,6 +1143,10 @@ finish( sig_desc = ""; msyslog(LOG_NOTICE, "%s exiting on signal %d (%s)", progname, sig, sig_desc); + if (HAVE_OPT( PIDFILE )) + if (-1 == unlink(OPT_ARG( PIDFILE ))) + msyslog(LOG_NOTICE, "unlink(\"%s\") failed: %m", + OPT_ARG( PIDFILE )); # ifdef HAVE_DNSREGISTRATION if (mdns != NULL) DNSServiceRefDeallocate(mdns);