2 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
7 * Copyright (c) 1983 Regents of the University of California.
8 * All rights reserved. The Berkeley software License Agreement
9 * specifies the terms and conditions for redistribution.
12 #pragma ident "%Z%%M% %I% %E% SMI"
16 static FILE *flog
= NULL
;
19 * Log file maintenance routines
22 logent(char *group
, char *num
, char *acu
, char *message
)
24 char *user
, *timestamp
;
31 if (flock(fileno(flog
), LOCK_EX
) < 0) {
36 if ((user
= getlogin()) == NOSTR
)
37 if ((pwd
= getpwuid(uid
)) == NOPWD
)
42 timestamp
= ctime(&t
);
44 (void) fprintf(flog
, "%s (%s) <%s, %s, %s> %s\n",
45 user
, timestamp
, group
,
54 (void) flock(fileno(flog
), LOCK_UN
);
63 flog
= fopen(value(LOG
), "a");
65 (void) fprintf(stderr
, "tip: can't open log file %s\r\n",