summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sbin/hastd/hastd.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sbin/hastd/hastd.c b/sbin/hastd/hastd.c
index b4b3c59..945f4dc 100644
--- a/sbin/hastd/hastd.c
+++ b/sbin/hastd/hastd.c
@@ -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.
*/
OpenPOWER on IntegriCloud