summaryrefslogtreecommitdiffstats
path: root/cmd/zed/zed_conf.c
diff options
context:
space:
mode:
authorChris Dunlap <[email protected]>2014-08-28 14:39:48 -0700
committerBrian Behlendorf <[email protected]>2014-09-02 14:18:53 -0700
commit8125fb71905cd97a5954db34014a455eb2c1c3d2 (patch)
tree59849762d8c7b67a71768c85865da57acacbe62c /cmd/zed/zed_conf.c
parent5a8855b716ad9177ed393769834ce9e08d2a3cfe (diff)
Cleanup zed logging
This is a set of minor cleanup changes related to zed logging: - Remove the program identity prefix from messages written to stderr since systemd already prepends this output with the program name. - Replace the copy of the program identity string with a ptr reference. - Replace "pid" with "PID" for consistency in comments & strings. - Rename the zed_log.c struct _ctx component "level" to "priority". - Add the LOG_PID option for messages written to syslog. Signed-off-by: Chris Dunlap <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Issue #2252
Diffstat (limited to 'cmd/zed/zed_conf.c')
-rw-r--r--cmd/zed/zed_conf.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/cmd/zed/zed_conf.c b/cmd/zed/zed_conf.c
index e6f601f3a..cf68c06fe 100644
--- a/cmd/zed/zed_conf.c
+++ b/cmd/zed/zed_conf.c
@@ -103,7 +103,7 @@ zed_conf_destroy(struct zed_conf *zcp)
if (zcp->pid_file) {
if ((unlink(zcp->pid_file) < 0) && (errno != ENOENT))
zed_log_msg(LOG_WARNING,
- "Failed to remove pid file \"%s\": %s",
+ "Failed to remove PID file \"%s\": %s",
zcp->pid_file, strerror(errno));
}
if (zcp->conf_file)
@@ -450,14 +450,14 @@ zed_conf_write_pid(struct zed_conf *zcp)
if (!zcp || !zcp->pid_file) {
errno = EINVAL;
- zed_log_msg(LOG_ERR, "Failed to write pid file: %s",
+ zed_log_msg(LOG_ERR, "Failed to write PID file: %s",
strerror(errno));
return (-1);
}
n = strlcpy(dirbuf, zcp->pid_file, sizeof (dirbuf));
if (n >= sizeof (dirbuf)) {
errno = ENAMETOOLONG;
- zed_log_msg(LOG_WARNING, "Failed to write pid file: %s",
+ zed_log_msg(LOG_WARNING, "Failed to write PID file: %s",
strerror(errno));
return (-1);
}
@@ -479,13 +479,13 @@ zed_conf_write_pid(struct zed_conf *zcp)
umask(mask);
if (!fp) {
- zed_log_msg(LOG_WARNING, "Failed to open pid file \"%s\": %s",
+ zed_log_msg(LOG_WARNING, "Failed to open PID file \"%s\": %s",
zcp->pid_file, strerror(errno));
} else if (fprintf(fp, "%d\n", (int) getpid()) == EOF) {
- zed_log_msg(LOG_WARNING, "Failed to write pid file \"%s\": %s",
+ zed_log_msg(LOG_WARNING, "Failed to write PID file \"%s\": %s",
zcp->pid_file, strerror(errno));
} else if (fclose(fp) == EOF) {
- zed_log_msg(LOG_WARNING, "Failed to close pid file \"%s\": %s",
+ zed_log_msg(LOG_WARNING, "Failed to close PID file \"%s\": %s",
zcp->pid_file, strerror(errno));
} else {
return (0);
@@ -564,7 +564,7 @@ zed_conf_open_state(struct zed_conf *zcp)
zcp->state_file);
} else if (pid > 0) {
zed_log_msg(LOG_WARNING,
- "Found pid %d bound to state file \"%s\"",
+ "Found PID %d bound to state file \"%s\"",
pid, zcp->state_file);
} else {
zed_log_msg(LOG_WARNING,