don't change errno on success.(SUSV2)

this will fix error messages of some commands like setkey(8).
This commit is contained in:
yamt 2001-08-24 00:11:54 +00:00
parent f63829f8b0
commit e42129c827

View File

@ -1,4 +1,4 @@
/* $NetBSD: __strerror.c,v 1.16 1999/09/20 04:39:43 lukem Exp $ */
/* $NetBSD: __strerror.c,v 1.17 2001/08/24 00:11:54 yamt Exp $ */
/*
* Copyright (c) 1988 Regents of the University of California.
@ -38,7 +38,7 @@
#if 0
static char *sccsid = "@(#)strerror.c 5.6 (Berkeley) 5/4/91";
#else
__RCSID("$NetBSD: __strerror.c,v 1.16 1999/09/20 04:39:43 lukem Exp $");
__RCSID("$NetBSD: __strerror.c,v 1.17 2001/08/24 00:11:54 yamt Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@ -70,6 +70,7 @@ __strerror(num, buf, buflen)
unsigned int errnum;
#ifdef NLS
int saved_errno = errno;
nl_catd catd ;
catd = catopen("libc", 0);
#endif
@ -95,6 +96,7 @@ __strerror(num, buf, buflen)
#ifdef NLS
catclose(catd);
errno = saved_errno;
#endif
return buf;