summaryrefslogtreecommitdiff
path: root/usr/src/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/cmd')
-rw-r--r--usr/src/cmd/logger/logger.c21
-rw-r--r--usr/src/cmd/syslogd/syslogd.c18
2 files changed, 24 insertions, 15 deletions
diff --git a/usr/src/cmd/logger/logger.c b/usr/src/cmd/logger/logger.c
index 5103750e22..35e3b322cb 100644
--- a/usr/src/cmd/logger/logger.c
+++ b/usr/src/cmd/logger/logger.c
@@ -19,6 +19,7 @@
* CDDL HEADER END
*/
/*
+ * Copyright (c) 2013 Gary Mills
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -36,7 +37,6 @@
* contributors.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/types.h>
#include <unistd.h>
@@ -85,8 +85,13 @@ static struct code FacNames[] = {
"lpr", LOG_LPR,
"news", LOG_NEWS,
"uucp", LOG_UUCP,
- "cron", LOG_CRON,
+ "altcron", LOG_ALTCRON,
+ "authpriv", LOG_AUTHPRIV,
+ "ftp", LOG_FTP,
+ "ntp", LOG_NTP,
"audit", LOG_AUDIT,
+ "console", LOG_CONSOLE,
+ "cron", LOG_CRON,
"local0", LOG_LOCAL0,
"local1", LOG_LOCAL1,
"local2", LOG_LOCAL2,
@@ -140,21 +145,21 @@ main(int argc, char **argv)
while ((opt = getopt(argc, argv, "it:p:f:")) != EOF)
switch (opt) {
- case 't': /* tag */
+ case 't': /* tag */
tag = optarg;
break;
- case 'p': /* priority */
+ case 'p': /* priority */
pri = pencode(optarg);
break;
- case 'i': /* log process id also */
+ case 'i': /* log process id also */
logflags |= LOG_PID;
pid_len = sprintf(tmp, "%ld", (long)getpid());
pid_len = (pid_len <= 0) ? 0 : pid_len +2;
break;
- case 'f': /* file to log */
+ case 'f': /* file to log */
if (strcmp(optarg, "-") == 0)
break;
infile = optarg;
@@ -165,7 +170,7 @@ main(int argc, char **argv)
}
break;
- default:
+ default:
usage();
}
@@ -359,6 +364,6 @@ usage(void)
(void) fprintf(stderr, gettext(
"Usage:\tlogger string\n"
"\tlogger [-i] [-f filename] [-p priority] [-t tag] "
- "[message] ...\n"));
+ "[message] ...\n"));
exit(1);
}
diff --git a/usr/src/cmd/syslogd/syslogd.c b/usr/src/cmd/syslogd/syslogd.c
index 7b9e352d48..ed9d41ec60 100644
--- a/usr/src/cmd/syslogd/syslogd.c
+++ b/usr/src/cmd/syslogd/syslogd.c
@@ -22,6 +22,7 @@
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
* Copyright 2012 Milan Jurik. All rights reserved.
+ * Copyright (c) 2013 Gary Mills
*/
/*
@@ -155,7 +156,12 @@ static struct code FacNames[] = {
"lpr", LOG_LPR,
"news", LOG_NEWS,
"uucp", LOG_UUCP,
+ "altcron", LOG_ALTCRON,
+ "authpriv", LOG_AUTHPRIV,
+ "ftp", LOG_FTP,
+ "ntp", LOG_NTP,
"audit", LOG_AUDIT,
+ "console", LOG_CONSOLE,
"cron", LOG_CRON,
"local0", LOG_LOCAL0,
"local1", LOG_LOCAL1,
@@ -617,12 +623,10 @@ sys_poll(void *ap)
DPRINT1(1, "sys_poll(%u): sys_thread started\n", mythreadno);
/*
- * Try to process as many messages as we can without blocking on poll.
- * We count such "initial" messages with sys_init_msg_count and
- * enqueue them without the SYNC_FILE flag. When no more data is
- * waiting on the local log device, we set timeout to INFTIM,
- * clear sys_init_msg_count, and generate a flush message to sync
- * the previously counted initial messages out to disk.
+ * Process messages, blocking on poll because timeout is set
+ * to INFTIM. When poll returns with a message, call getkmsg
+ * to pull up one message from the log driver and enqueue it
+ * with the sync flag set.
*/
sys_init_msg_count = 0;
@@ -695,7 +699,7 @@ getkmsg(int timeout)
lastline = &dat.buf[dat.len];
*lastline = '\0';
- DPRINT2(5, "sys_poll:(%u): getmsg: dat.len = %d\n",
+ DPRINT2(5, "getkmsg:(%u): getmsg: dat.len = %d\n",
mythreadno, dat.len);
buflen = strlen(buf);
len = findnl_bkwd(buf, buflen);