summaryrefslogtreecommitdiffstats
path: root/usr.sbin/fifolog
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2008-03-31 13:56:15 +0000
committerphk <phk@FreeBSD.org>2008-03-31 13:56:15 +0000
commita940156e22ca93cf2dd05fe7285ac94c3cb974cd (patch)
treed91a579045a70234cb067aa4de5e0ad2e3372772 /usr.sbin/fifolog
parent2b290549e3a05a60dc84e11b8bcbb5040ad3063a (diff)
downloadFreeBSD-src-a940156e22ca93cf2dd05fe7285ac94c3cb974cd.zip
FreeBSD-src-a940156e22ca93cf2dd05fe7285ac94c3cb974cd.tar.gz
Accept empty -T arguments.
Proposed by: clemens fischer <ino-qc@spotteswoode.de.eu.org>
Diffstat (limited to 'usr.sbin/fifolog')
-rw-r--r--usr.sbin/fifolog/fifolog_reader/Makefile2
-rw-r--r--usr.sbin/fifolog/fifolog_reader/fifolog_reader.c4
2 files changed, 5 insertions, 1 deletions
diff --git a/usr.sbin/fifolog/fifolog_reader/Makefile b/usr.sbin/fifolog/fifolog_reader/Makefile
index 99294da..07c5b7d 100644
--- a/usr.sbin/fifolog/fifolog_reader/Makefile
+++ b/usr.sbin/fifolog/fifolog_reader/Makefile
@@ -16,6 +16,8 @@ test: ${PROG}
./${PROG} -t /tmp/fifolog.0
./${PROG} /tmp/fifolog.1
./${PROG} -B "00:00" /tmp/fifolog.1
+ ./${PROG} -T "%y%m%d-%H%M%S" /tmp/fifolog.1
+ ./${PROG} -T "" /tmp/fifolog.1
t2:
./${PROG} -t /critter/10.1.29.74.fifolog
diff --git a/usr.sbin/fifolog/fifolog_reader/fifolog_reader.c b/usr.sbin/fifolog/fifolog_reader/fifolog_reader.c
index 6c4dc41..b469a3c 100644
--- a/usr.sbin/fifolog/fifolog_reader/fifolog_reader.c
+++ b/usr.sbin/fifolog/fifolog_reader/fifolog_reader.c
@@ -59,7 +59,9 @@ Render(void *priv __unused, time_t now, unsigned flag __unused, const unsigned c
if (opt_R != NULL && regexec(&R, (const char *)p, 0, NULL, 0))
return;
- if (opt_T != NULL) {
+ if (opt_T != NULL && *opt_T == '\0') {
+ fprintf(fo, "%s\n", p);
+ } else if (opt_T != NULL) {
(void)gmtime_r(&now, &utc);
i = strftime(buf, sizeof buf, opt_T, &utc);
assert(i > 0);
OpenPOWER on IntegriCloud