paniclog prefix (trunk only)
Extend the identifying information used to prefix paniclog entries
from version + date to version + date + time + userid + mode (where mode
is 'D' for wizard mode, 'X' for discover mode, and '-' for normal play).
hacklib.c ended up getting more of a revision than I intended, but
the date/time handling routines now have less clutter. I hope I didn't
break anything in the process.
This commit is contained in:
15
src/files.c
15
src/files.c
@@ -927,10 +927,9 @@ create_savefile()
|
||||
the default for non-privileged users, but for priv'd users the
|
||||
file will be owned by the directory's owner instead of the user.
|
||||
*/
|
||||
# ifdef getuid /*(see vmsunix.c)*/
|
||||
# undef getuid
|
||||
# endif
|
||||
# undef getuid
|
||||
(void) chown(fq_save, getuid(), getgid());
|
||||
# define getuid() vms_getuid()
|
||||
# endif /* VMS && !SECURE */
|
||||
#endif /* MICRO */
|
||||
|
||||
@@ -2776,8 +2775,14 @@ const char *reason; /* explanation */
|
||||
program_state.in_paniclog = 1;
|
||||
lfile = fopen_datafile(PANICLOG, "a", TROUBLEPREFIX);
|
||||
if (lfile) {
|
||||
(void) fprintf(lfile, "%s %08ld: %s %s\n",
|
||||
version_string(buf), yyyymmdd((time_t)0L),
|
||||
time_t now = getnow();
|
||||
int uid = getuid();
|
||||
char playmode = wizard ? 'D' : discover ? 'X' : '-';
|
||||
|
||||
(void) fprintf(lfile, "%s %08ld %06ld %d %c: %s %s\n",
|
||||
version_string(buf),
|
||||
yyyymmdd(now), hhmmss(now),
|
||||
uid, playmode,
|
||||
type, reason);
|
||||
(void) fclose(lfile);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user