- register FILE *fp;
- register char **mess;
- struct tm *tm, *localtime();
-
- tm = localtime(&now);
- fp = fopen(LOGFILE, "a");
- if (fp==0)
- return;
- fseek(fp, 0L, 2);
- fprintf(fp, "%02d:%02d %s %s %2d, %4d. Shutdown:", tm->tm_hour,
- tm->tm_min, days[tm->tm_wday], months[tm->tm_mon],
- tm->tm_mday, tm->tm_year + 1900);
- for (mess = nolog2; *mess; mess++)
- fprintf(fp, " %s", *mess);
- if (shutter)
- fprintf(fp, " (by %s)", shutter);
- fputc('\n', fp);
- fclose(fp);