Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/subr_msgbuf.c
Show First 20 Lines • Show All 228 Lines • ▼ Show 20 Lines | if ((mbp->msg_flags & MSGBUF_NEEDNL) == 0 && prefix_len != 0) { | ||||
int j; | int j; | ||||
for (j = 0; j < prefix_len; j++) | for (j = 0; j < prefix_len; j++) | ||||
msgbuf_do_addchar(mbp, prefix[j]); | msgbuf_do_addchar(mbp, prefix[j]); | ||||
} | } | ||||
if (msgbuf_show_timestamp && needtime == 1 && | if (msgbuf_show_timestamp && needtime == 1 && | ||||
(mbp->msg_flags & MSGBUF_NEEDNL) == 0) { | (mbp->msg_flags & MSGBUF_NEEDNL) == 0) { | ||||
if (msgbuf_show_timestamp == 1) { | |||||
snprintf(buf, sizeof(buf), "[%jd] ", | snprintf(buf, sizeof(buf), "[%jd] ", | ||||
(intmax_t)time_uptime); | (intmax_t)time_uptime); | ||||
} else { | |||||
struct timeval tv; | |||||
microuptime(&tv); | |||||
snprintf(buf, sizeof(buf), "[%jd.%06d] ", | |||||
(intmax_t)tv.tv_sec, (int)tv.tv_usec); | |||||
} | |||||
for (j = 0; buf[j] != '\0'; j++) | for (j = 0; buf[j] != '\0'; j++) | ||||
msgbuf_do_addchar(mbp, buf[j]); | msgbuf_do_addchar(mbp, buf[j]); | ||||
needtime = 0; | needtime = 0; | ||||
} | } | ||||
/* | /* | ||||
* Don't copy carriage returns if the caller requested | * Don't copy carriage returns if the caller requested | ||||
* filtering. | * filtering. | ||||
▲ Show 20 Lines • Show All 180 Lines • Show Last 20 Lines |