aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2013-05-30 19:16:17 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2013-06-01 01:10:43 +0300
commit1e95f8da2e8e0de5d2c5217f02d35f4e5b081abe (patch)
tree6087c3e139222011f47d1d5f617cb3a559c6137e /src
parenta34424338896834d7c755e563b2d3fbf72e5c46d (diff)
downloaddirevent-1e95f8da2e8e0de5d2c5217f02d35f4e5b081abe.tar.gz
direvent-1e95f8da2e8e0de5d2c5217f02d35f4e5b081abe.tar.bz2
Minor improvements
* /src/dircond.c (vdiag): Implement print-priority. (main): Print version number along with the startup and shutdown messages.
Diffstat (limited to 'src')
-rw-r--r--src/dircond.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/dircond.c b/src/dircond.c
index 041e64a..c1049fe 100644
--- a/src/dircond.c
+++ b/src/dircond.c
@@ -79,7 +79,27 @@ vdiag(int prio, const char *fmt, va_list ap)
vfprintf(stderr, fmt, ap);
fputc('\n', stderr);
} else {
- vsyslog(prio, fmt, ap);
+ if (syslog_include_prio && (s = severity(prio)) != NULL) {
+ static char *fmtbuf;
+ static size_t fmtsize;
+ size_t len = strlen(fmt) + strlen(s) + 3;
+ char *p;
+
+ if (len > fmtsize) {
+ fmtbuf = erealloc(fmtbuf, len);
+ fmtsize = len;
+ }
+
+ p = fmtbuf;
+ *p++ = '[';
+ while (*s)
+ *p++ = *s++;
+ *p++ = ']';
+ *p++ = ' ';
+ while (*p++ = *fmt++);
+ vsyslog(prio, fmtbuf, ap);
+ } else
+ vsyslog(prio, fmt, ap);
}
}
@@ -529,7 +549,7 @@ main(int argc, char **argv)
if (facility > 0)
openlog(tag, LOG_PID, facility);
- diag(LOG_INFO, "started");
+ diag(LOG_INFO, "%s %s started", program_name, VERSION);
/* Write pidfile */
if (pidfile)
@@ -548,7 +568,7 @@ main(int argc, char **argv)
process_cleanup(0);
} while (evsys_select () == 0);
- diag(LOG_INFO, "stopped");
+ diag(LOG_INFO, "%s %s stopped", program_name, VERSION);
return 0;
}

Return to:

Send suggestions and report system problems to the System administrator.