From e42129c827a154a4e68a5fee005b9eb553bf7b94 Mon Sep 17 00:00:00 2001 From: yamt Date: Fri, 24 Aug 2001 00:11:54 +0000 Subject: don't change errno on success.(SUSV2) this will fix error messages of some commands like setkey(8). --- lib/libc/string/__strerror.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/libc/string') diff --git a/lib/libc/string/__strerror.c b/lib/libc/string/__strerror.c index 59cee14a006..241df192625 100644 --- a/lib/libc/string/__strerror.c +++ b/lib/libc/string/__strerror.c @@ -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; -- cgit