Lines 194-200
Link Here
|
194 |
time_t now; |
194 |
time_t now; |
195 |
FILE *fp; |
195 |
FILE *fp; |
196 |
int fd; |
196 |
int fd; |
197 |
char hostname[MAXHOSTNAMELEN], tmpname[64]; |
197 |
char hostname[MAXHOSTNAMELEN], tmpname[64], datestr[20]; |
198 |
wchar_t *p, *tmp, lbuf[256], codebuf[13]; |
198 |
wchar_t *p, *tmp, lbuf[256], codebuf[13]; |
199 |
const char *tty; |
199 |
const char *tty; |
200 |
const char *whom; |
200 |
const char *whom; |
Lines 215-220
Link Here
|
215 |
(void)gethostname(hostname, sizeof(hostname)); |
215 |
(void)gethostname(hostname, sizeof(hostname)); |
216 |
(void)time(&now); |
216 |
(void)time(&now); |
217 |
lt = localtime(&now); |
217 |
lt = localtime(&now); |
|
|
218 |
(void)strftime(datestr, sizeof datestr, "%b %d %H:%M %Z", lt); |
218 |
|
219 |
|
219 |
/* |
220 |
/* |
220 |
* all this stuff is to blank out a square for the message; |
221 |
* all this stuff is to blank out a square for the message; |
Lines 229-236
Link Here
|
229 |
whom, hostname); |
230 |
whom, hostname); |
230 |
(void)fwprintf(fp, L"%-79.79S\007\007\r\n", lbuf); |
231 |
(void)fwprintf(fp, L"%-79.79S\007\007\r\n", lbuf); |
231 |
(void)swprintf(lbuf, sizeof(lbuf)/sizeof(wchar_t), |
232 |
(void)swprintf(lbuf, sizeof(lbuf)/sizeof(wchar_t), |
232 |
L" (%s) at %d:%02d %s...", tty, |
233 |
L" (%s) at %s...", tty, datestr); |
233 |
lt->tm_hour, lt->tm_min, lt->tm_zone); |
|
|
234 |
(void)fwprintf(fp, L"%-79.79S\r\n", lbuf); |
234 |
(void)fwprintf(fp, L"%-79.79S\r\n", lbuf); |
235 |
} |
235 |
} |
236 |
(void)fwprintf(fp, L"%79s\r\n", " "); |
236 |
(void)fwprintf(fp, L"%79s\r\n", " "); |