* libmisc/setugid.c, src/login_nopam.c, src/suauth.c,

lib/getdef.c: Replace the %m format string by strerror(). This
	avoids errno to be reset between the system call error and the
	report function.
This commit is contained in:
nekral-guest
2008-09-13 18:03:50 +00:00
parent 0833bc3cc0
commit 5df1f2f683
5 changed files with 31 additions and 14 deletions

View File

@@ -39,6 +39,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <errno.h>
#include "getdef.h"
/*
* A configuration item definition.
@@ -377,8 +378,9 @@ static void def_load (void)
*/
fp = fopen (def_fname, "r");
if (NULL == fp) {
SYSLOG ((LOG_CRIT, "cannot open login definitions %s [%m]",
def_fname));
int err = errno;
SYSLOG ((LOG_CRIT, "cannot open login definitions %s [%s]",
def_fname, strerror (err)));
exit (1);
}
@@ -426,8 +428,9 @@ static void def_load (void)
}
if (ferror (fp) != 0) {
SYSLOG ((LOG_CRIT, "cannot read login definitions %s [%m]",
def_fname));
int err = errno;
SYSLOG ((LOG_CRIT, "cannot read login definitions %s [%s]",
def_fname, strerror (err)));
exit (1);
}