/* @(#)logent 2.1 5/18/79 13:27:52 */
char Slogent
[] = "@(#)logent 2.1";
char Tmplog
[MAXFULLNAME
] = "";
* logent(text, status) make log entry
/* make entry in existing temp log file */
mlogent(Lp
, status
, text
);
if (ulockf(LOGLOCK
, 10l) == 0) {
if ((fp
= fopen(LOGFILE
, "a")) == NULL
) {
mlogent(fp
, status
, text
);
/* make a temp log file */
for (n
= 0; n
< 10; n
++) {
sprintf(Tmplog
, "%s/LOG.%05d.%1d", LOGDIR
, getpid(), n
);
if (access(Tmplog
, 0) == -1)
if ((Lp
= fopen(Tmplog
, "w")) == NULL
)
mlogent(Lp
, status
, text
);
* mlogent(fp, status, text) - make a log entry
mlogent(fp
, status
, text
)
extern struct tm
*localtime();
fprintf(fp
, "%s %s ", User
, Rmtname
);
fprintf(fp
, "(%d/%d-%d:%d-%d) ", tp
->tm_mon
+ 1,
tp
->tm_mday
, tp
->tm_hour
, tp
->tm_min
, pid
);
fprintf(fp
, "%s (%s)\n", status
, text
);
* logcls() close log file
* syslog(text) make system log entry
extern struct tm
*localtime();
fprintf(fp
, "%s %s ", User
, Rmtname
);
fprintf(fp
, "(%d/%d-%d:%d) ", tp
->tm_mon
+ 1,
tp
->tm_mday
, tp
->tm_hour
, tp
->tm_min
);
fprintf(fp
, "%s\n", text
);