aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJake Freeland <jfree@FreeBSD.org>2023-09-01 02:49:36 +0000
committerMark Johnston <markj@FreeBSD.org>2023-09-28 15:51:52 +0000
commit1bb61348e69e6facc1fbac49d82236218028eeb8 (patch)
tree2b9cb0dc122c9c02671014baba8556e1738f621a
parentf804f23650815dd3a96b3ab2b24152d25c7364c3 (diff)
downloadsrc-1bb61348e69e6facc1fbac49d82236218028eeb8.tar.gz
src-1bb61348e69e6facc1fbac49d82236218028eeb8.zip
syslogd: Use boolean reload parameter for init()
Replace init()'s integer "signo" parameter with boolean "reload" for clarity. Reviewed by: markj, emaste MFC after: 3 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D41416
-rw-r--r--usr.sbin/syslogd/syslogd.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c
index 21e2d48b0c37..b61a10c20aca 100644
--- a/usr.sbin/syslogd/syslogd.c
+++ b/usr.sbin/syslogd/syslogd.c
@@ -434,7 +434,7 @@ static void fprintlog_first(struct filed *, const char *, const char *,
const char *, const char *, const char *, const char *, int);
static void fprintlog_write(struct filed *, struct iovlist *, int);
static void fprintlog_successive(struct filed *, int);
-static void init(int);
+static void init(bool);
static void logerror(const char *);
static void logmsg(int, const struct logtime *, const char *, const char *,
const char *, const char *, const char *, const char *, int);
@@ -2493,7 +2493,7 @@ readconfigfile(const char *path)
* INIT -- Initialize syslogd from configuration table
*/
static void
-init(int signo)
+init(bool reload)
{
int i;
struct filed *f;
@@ -2507,7 +2507,7 @@ init(int signo)
/*
* Load hostname (may have changed).
*/
- if (signo != 0)
+ if (reload)
(void)strlcpy(oldLocalHostName, LocalHostName,
sizeof(oldLocalHostName));
if (gethostname(LocalHostName, sizeof(LocalHostName)))
@@ -2651,9 +2651,9 @@ init(int signo)
NULL, NULL, "restart", 0);
dprintf("syslogd: restarted\n");
/*
- * Log a change in hostname, but only on a restart.
+ * Log a change in hostname, but only on reload.
*/
- if (signo != 0 && strcmp(oldLocalHostName, LocalHostName) != 0) {
+ if (reload && strcmp(oldLocalHostName, LocalHostName) != 0) {
(void)snprintf(hostMsg, sizeof(hostMsg),
"hostname changed, \"%s\" to \"%s\"",
oldLocalHostName, LocalHostName);
@@ -2663,9 +2663,9 @@ init(int signo)
}
/*
* Log the kernel boot file if we aren't going to use it as
- * the prefix, and if this is *not* a restart.
+ * the prefix, and if this is *not* a reload.
*/
- if (signo == 0 && !use_bootfile) {
+ if (!reload && !use_bootfile) {
(void)snprintf(bootfileMsg, sizeof(bootfileMsg),
"kernel boot file is %s", bootfile);
logmsg(LOG_KERN | LOG_INFO, NULL, LocalHostName, "syslogd",