Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/string don't change errno on success.(SUSV2)



details:   https://anonhg.NetBSD.org/src/rev/ee4cdaad97d5
branches:  trunk
changeset: 514140:ee4cdaad97d5
user:      yamt <yamt%NetBSD.org@localhost>
date:      Fri Aug 24 00:11:54 2001 +0000

description:
don't change errno on success.(SUSV2)
this will fix error messages of some commands like setkey(8).

diffstat:

 lib/libc/string/__strerror.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (34 lines):

diff -r c351e0e72a4b -r ee4cdaad97d5 lib/libc/string/__strerror.c
--- a/lib/libc/string/__strerror.c      Thu Aug 23 19:59:44 2001 +0000
+++ b/lib/libc/string/__strerror.c      Fri Aug 24 00:11:54 2001 +0000
@@ -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 @@
        unsigned int errnum;
 
 #ifdef NLS
+       int saved_errno = errno;
        nl_catd catd ;
        catd = catopen("libc", 0);
 #endif
@@ -95,6 +96,7 @@
 
 #ifdef NLS
        catclose(catd);
+       errno = saved_errno;
 #endif
 
        return buf;



Home | Main Index | Thread Index | Old Index