Date: Tue, 10 Jan 2012 22:41:09 +0000 (UTC) From: Pawel Jakub Dawidek <pjd@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r229946 - head/sbin/hastd Message-ID: <201201102241.q0AMf9YA030753@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pjd Date: Tue Jan 10 22:41:09 2012 New Revision: 229946 URL: http://svn.freebsd.org/changeset/base/229946 Log: - 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 Modified: head/sbin/hastd/hastd.c Modified: head/sbin/hastd/hastd.c ============================================================================== --- head/sbin/hastd/hastd.c Tue Jan 10 22:39:07 2012 (r229945) +++ head/sbin/hastd/hastd.c Tue Jan 10 22:41:09 2012 (r229946) @@ -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. */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201201102241.q0AMf9YA030753>