Make newsyslog(8) print the correct date when the logs are turned over.

PR:		46395
Submitted by:	maxim
MFC:		eventually
This commit is contained in:
trhodes 2002-12-21 22:27:26 +00:00
parent d025aceb5b
commit 629bbce50c

View File

@ -102,7 +102,7 @@ time_t timenow;
#define MIN_PID 5 #define MIN_PID 5
#define MAX_PID 99999 /* was lower, see /usr/include/sys/proc.h */ #define MAX_PID 99999 /* was lower, see /usr/include/sys/proc.h */
char hostname[MAXHOSTNAMELEN]; /* hostname */ char hostname[MAXHOSTNAMELEN]; /* hostname */
char *daytime; /* timenow in human readable form */ char daytime[16]; /* timenow in human readable form */
static struct conf_entry *parse_file(char **files); static struct conf_entry *parse_file(char **files);
static char *sob(char *p); static char *sob(char *p);
@ -238,7 +238,7 @@ PRS(int argc, char **argv)
char *p; char *p;
timenow = time((time_t *) 0); timenow = time((time_t *) 0);
daytime = ctime(&timenow) + 4; (void)strncpy(daytime, ctime(&timenow) + 4, 15);
daytime[15] = '\0'; daytime[15] = '\0';
/* Let's get our hostname */ /* Let's get our hostname */