1 --- mgetty-1.1.30.orig/logfile.c 2002-11-25 08:08:26.000000000 -0500
2 +++ mgetty-1.1.30/logfile.c 2003-04-28 00:08:35.000000000 -0400
4 /* Most systems have these variables but do not declare them. On many
5 of those systems that _do_ declare them, it won't hurt */
8 -#if !defined(__NetBSD__) && !defined( __FreeBSD__ ) && !defined(__OpenBSD__) && !defined(__GLIBC__) && !defined(__MACH__)
9 -extern char *sys_errlist[];
11 +/* commented in by was@debian.org on Wed, 27 Nov 2002 01:15:11 -0500
12 + because sys_nerr and sys_errlist are deprecated. strerror() is used
15 +/* extern int sys_nerr; */
16 +/* #if !defined(__NetBSD__) && !defined( __FreeBSD__ ) && !defined(__OpenBSD__) && !defined(__GLIBC__) && !defined(__MACH__) */
17 +/* extern char *sys_errlist[]; */
20 /* Interactive Unix is a little bit braindead - does not have atexit(),
27 static int first_open = TRUE;
29 if ( level > log_level ) /* log level high enough? */
32 else /* ERROR or FATAL */
34 + error_string = strerror (errnr);
35 + if ( error_string == NULL )
37 + if ( errno == EINVAL )
38 + error_string = "<error not in list>";
40 + error_string = "<error calling strerror()>";
43 fprintf(log_fp, "\n%02d/%02d %02d:%02d:%02d %s %s: %s",
44 tm->tm_mon+1, tm->tm_mday,
45 tm->tm_hour, tm->tm_min, tm->tm_sec,
47 - ( errnr <= sys_nerr ) ? sys_errlist[errnr]:
48 - "<error not in list>" );
51 syslog( level == L_FATAL? LOG_ALERT: LOG_ERR, "%s: %m", ws );