22 lines
467 B
Plaintext
22 lines
467 B
Plaintext
$OpenBSD: patch-source_log_c,v 1.2 2009/06/02 17:59:43 naddy Exp $
|
|
--- source/log.c.orig Wed Sep 27 05:16:29 2006
|
|
+++ source/log.c Tue May 19 10:24:31 2009
|
|
@@ -170,9 +170,16 @@ add_to_log(fp, line)
|
|
FILE *fp;
|
|
u_char *line;
|
|
{
|
|
+ time_t t;
|
|
+ struct tm *tm;
|
|
+ char buf[32];
|
|
+
|
|
if (fp)
|
|
{
|
|
- fprintf(fp, "%s\n", line);
|
|
+ t = time(0);
|
|
+ tm = localtime(&t);
|
|
+ strftime(buf, sizeof buf, "%b %d %R", tm);
|
|
+ fprintf(fp, "[%s] %s\n", buf, line);
|
|
fflush(fp);
|
|
}
|
|
}
|