#ifndef lint
static const char rcsid[] =
- "$Id$";
+ "$FreeBSD$";
#endif /* not lint */
#include <fcntl.h>
+#include <string.h>
+#include <stdarg.h>
#include "pw.h"
}
if (logfile != NULL) {
va_list argp;
- int l;
time_t now = time(NULL);
struct tm *t = localtime(&now);
char nfmt[256];
- char *name;
+ const char *name;
if ((name = getenv("LOGNAME")) == NULL && (name = getenv("USER")) == NULL)
name = "unknown";
- strftime(nfmt, sizeof nfmt, "%d-%b-%Y %R ", t);
- l = strlen(nfmt);
+ /* ISO 8601 International Standard Date format */
+ strftime(nfmt, sizeof nfmt, "%Y-%m-%d %T ", t);
sprintf(nfmt + strlen(nfmt), "[%s:%s%s] %s\n", name, Which[which], Modes[mode], fmt);
va_start(argp, fmt);
vfprintf(logfile, nfmt, argp);