- Fix a bug where pidfile was removed in SIGHUP when it hasn't changed in

configuration file.
- Log the fact that pidfile has changed.

MFC after:	3 days
This commit is contained in:
Pawel Jakub Dawidek 2012-01-10 22:41:09 +00:00
parent 2b1b224d24
commit 4bbeefbb07
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=229946

View File

@ -573,10 +573,14 @@ hastd_reload(void)
/*
* Switch to new pidfile.
*/
(void)pidfile_remove(pfh);
pfh = newpfh;
(void)strlcpy(cfg->hc_pidfile, newcfg->hc_pidfile,
sizeof(cfg->hc_pidfile));
if (newpfh != NULL) {
pjdlog_info("Pidfile changed from %s to %s.", cfg->hc_pidfile,
newcfg->hc_pidfile);
(void)pidfile_remove(pfh);
pfh = newpfh;
(void)strlcpy(cfg->hc_pidfile, newcfg->hc_pidfile,
sizeof(cfg->hc_pidfile));
}
/*
* Switch to new listen addresses. Close all that were removed.
*/