Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/arch save errno while trying to install a !SA_SIGIN...



details:   https://anonhg.NetBSD.org/src/rev/f142fd0e199f
branches:  trunk
changeset: 559766:f142fd0e199f
user:      drochner <drochner%NetBSD.org@localhost>
date:      Tue Mar 23 16:19:40 2004 +0000

description:
save errno while trying to install a !SA_SIGINFO trampoline -- this
is expected to fail with !COMPAT_16 kernels, and we shouldn't
overwrite errno in this case

diffstat:

 lib/libc/arch/alpha/sys/__sigaction14_sigtramp.c   |  4 +++-
 lib/libc/arch/arm/sys/__sigaction14_sigtramp.c     |  4 +++-
 lib/libc/arch/i386/sys/__sigaction14_sigtramp.c    |  4 +++-
 lib/libc/arch/m68k/sys/__sigaction14_sigtramp.c    |  4 +++-
 lib/libc/arch/mips/sys/__sigaction14_sigtramp.c    |  4 +++-
 lib/libc/arch/ns32k/sys/__sigaction14_sigtramp.c   |  4 +++-
 lib/libc/arch/powerpc/sys/__sigaction14_sigtramp.c |  4 +++-
 lib/libc/arch/sh3/sys/__sigaction14_sigtramp.c     |  4 +++-
 lib/libc/arch/sh5/sys/__sigaction14_sigtramp.c     |  4 +++-
 lib/libc/arch/sparc/sys/__sigaction14_sigtramp.c   |  4 +++-
 lib/libc/arch/sparc64/sys/__sigaction14_sigtramp.c |  4 +++-
 lib/libc/arch/vax/sys/__sigaction14_sigtramp.c     |  4 +++-
 lib/libc/arch/x86_64/sys/__sigaction14_sigtramp.c  |  4 +++-
 13 files changed, 39 insertions(+), 13 deletions(-)

diffs (295 lines):

diff -r a9bc744352e6 -r f142fd0e199f lib/libc/arch/alpha/sys/__sigaction14_sigtramp.c
--- a/lib/libc/arch/alpha/sys/__sigaction14_sigtramp.c  Tue Mar 23 16:13:27 2004 +0000
+++ b/lib/libc/arch/alpha/sys/__sigaction14_sigtramp.c  Tue Mar 23 16:19:40 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: __sigaction14_sigtramp.c,v 1.4 2003/10/18 18:33:51 christos Exp $      */
+/*     $NetBSD: __sigaction14_sigtramp.c,v 1.5 2004/03/23 16:19:40 drochner Exp $      */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -64,10 +64,12 @@
         * set in the sigaction.
         */
        if ((act->sa_flags & SA_SIGINFO) == 0) {
+               int sav = errno;
                rv =  __sigaction_sigtramp(sig, act, oact,
                    __sigtramp_sigcontext_1, 1);
                if (rv >= 0 || errno != EINVAL)
                        return rv;
+               errno = sav;
        }
 
        /*
diff -r a9bc744352e6 -r f142fd0e199f lib/libc/arch/arm/sys/__sigaction14_sigtramp.c
--- a/lib/libc/arch/arm/sys/__sigaction14_sigtramp.c    Tue Mar 23 16:13:27 2004 +0000
+++ b/lib/libc/arch/arm/sys/__sigaction14_sigtramp.c    Tue Mar 23 16:19:40 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: __sigaction14_sigtramp.c,v 1.3 2003/10/05 19:48:39 matt Exp $  */
+/*     $NetBSD: __sigaction14_sigtramp.c,v 1.4 2004/03/23 16:19:40 drochner Exp $      */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -64,10 +64,12 @@
         * set in the sigaction.
         */
        if ((act->sa_flags & SA_SIGINFO) == 0) {
+               int sav = errno;
                rv =  __sigaction_sigtramp(sig, act, oact,
                    __sigtramp_sigcontext_1, 1);
                if (rv >= 0 || errno != EINVAL)
                        return rv;
+               errno = sav;
        }
 
        /*
diff -r a9bc744352e6 -r f142fd0e199f lib/libc/arch/i386/sys/__sigaction14_sigtramp.c
--- a/lib/libc/arch/i386/sys/__sigaction14_sigtramp.c   Tue Mar 23 16:13:27 2004 +0000
+++ b/lib/libc/arch/i386/sys/__sigaction14_sigtramp.c   Tue Mar 23 16:19:40 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: __sigaction14_sigtramp.c,v 1.7 2003/10/12 04:23:17 christos Exp $      */
+/*     $NetBSD: __sigaction14_sigtramp.c,v 1.8 2004/03/23 16:19:40 drochner Exp $      */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -64,10 +64,12 @@
         * set in the sigaction.
         */
        if ((act->sa_flags & SA_SIGINFO) == 0) {
+               int sav = errno;
                rv =  __sigaction_sigtramp(sig, act, oact,
                    __sigtramp_sigcontext_1, 1);
                if (rv >= 0 || errno != EINVAL)
                        return rv;
+               errno = sav;
        }
 
        /*
diff -r a9bc744352e6 -r f142fd0e199f lib/libc/arch/m68k/sys/__sigaction14_sigtramp.c
--- a/lib/libc/arch/m68k/sys/__sigaction14_sigtramp.c   Tue Mar 23 16:13:27 2004 +0000
+++ b/lib/libc/arch/m68k/sys/__sigaction14_sigtramp.c   Tue Mar 23 16:19:40 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: __sigaction14_sigtramp.c,v 1.4 2003/10/18 18:16:23 christos Exp $      */
+/*     $NetBSD: __sigaction14_sigtramp.c,v 1.5 2004/03/23 16:19:41 drochner Exp $      */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -64,10 +64,12 @@
         * set in the sigaction.
         */
        if ((act->sa_flags & SA_SIGINFO) == 0) {
+               int sav = errno;
                rv =  __sigaction_sigtramp(sig, act, oact,
                    __sigtramp_sigcontext_1, 1);
                if (rv >= 0 || errno != EINVAL)
                        return rv;
+               errno = sav;
        }
 
        /*
diff -r a9bc744352e6 -r f142fd0e199f lib/libc/arch/mips/sys/__sigaction14_sigtramp.c
--- a/lib/libc/arch/mips/sys/__sigaction14_sigtramp.c   Tue Mar 23 16:13:27 2004 +0000
+++ b/lib/libc/arch/mips/sys/__sigaction14_sigtramp.c   Tue Mar 23 16:19:40 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: __sigaction14_sigtramp.c,v 1.3 2003/11/02 08:37:48 christos Exp $      */
+/*     $NetBSD: __sigaction14_sigtramp.c,v 1.4 2004/03/23 16:19:41 drochner Exp $      */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -64,10 +64,12 @@
         * set in the sigaction.
         */
        if ((act->sa_flags & SA_SIGINFO) == 0) {
+               int sav = errno;
                rv =  __sigaction_sigtramp(sig, act, oact,
                    __sigtramp_sigcontext_1, 1);
                if (rv >= 0 || errno != EINVAL)
                        return rv;
+               errno = sav;
        }
 
        /*
diff -r a9bc744352e6 -r f142fd0e199f lib/libc/arch/ns32k/sys/__sigaction14_sigtramp.c
--- a/lib/libc/arch/ns32k/sys/__sigaction14_sigtramp.c  Tue Mar 23 16:13:27 2004 +0000
+++ b/lib/libc/arch/ns32k/sys/__sigaction14_sigtramp.c  Tue Mar 23 16:19:40 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: __sigaction14_sigtramp.c,v 1.3 2003/11/11 19:10:02 simonb Exp $        */
+/*     $NetBSD: __sigaction14_sigtramp.c,v 1.4 2004/03/23 16:19:41 drochner Exp $      */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -66,10 +66,12 @@
         * set in the sigaction.
         */
        if ((act->sa_flags & SA_SIGINFO) == 0) {
+               int sav = errno;
                rv =  __sigaction_sigtramp(sig, act, oact,
                    __sigtramp_sigcontext_1, 1);
                if (rv >= 0 || errno != EINVAL)
                        return rv;
+               errno = sav;
        }
 
        /*
diff -r a9bc744352e6 -r f142fd0e199f lib/libc/arch/powerpc/sys/__sigaction14_sigtramp.c
--- a/lib/libc/arch/powerpc/sys/__sigaction14_sigtramp.c        Tue Mar 23 16:13:27 2004 +0000
+++ b/lib/libc/arch/powerpc/sys/__sigaction14_sigtramp.c        Tue Mar 23 16:19:40 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: __sigaction14_sigtramp.c,v 1.4 2003/09/27 03:33:00 matt Exp $  */
+/*     $NetBSD: __sigaction14_sigtramp.c,v 1.5 2004/03/23 16:19:41 drochner Exp $      */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -64,10 +64,12 @@
         * set in the sigaction.
         */
        if ((act->sa_flags & SA_SIGINFO) == 0) {
+               int sav = errno;
                rv =  __sigaction_sigtramp(sig, act, oact,
                    __sigtramp_sigcontext_1, 1);
                if (rv >= 0 || errno != EINVAL)
                        return rv;
+               errno = sav;
        }
 
        /*
diff -r a9bc744352e6 -r f142fd0e199f lib/libc/arch/sh3/sys/__sigaction14_sigtramp.c
--- a/lib/libc/arch/sh3/sys/__sigaction14_sigtramp.c    Tue Mar 23 16:13:27 2004 +0000
+++ b/lib/libc/arch/sh3/sys/__sigaction14_sigtramp.c    Tue Mar 23 16:19:40 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: __sigaction14_sigtramp.c,v 1.3 2003/11/23 23:13:11 uwe Exp $   */
+/*     $NetBSD: __sigaction14_sigtramp.c,v 1.4 2004/03/23 16:19:41 drochner Exp $      */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -58,6 +58,7 @@
         * is not set in the sigaction.
         */
        if (act && (act->sa_flags & SA_SIGINFO) == 0) {
+               int sav = errno;
                rv =  __sigaction_sigtramp(sig, act, oact,
                                           __sigtramp_sigcontext_1, 1);
                /*
@@ -67,6 +68,7 @@
                 */
                if (rv >= 0 || errno != EINVAL)
                        return rv;
+               errno = sav;
        }
 
        return __sigaction_sigtramp(sig, act, oact, __sigtramp_siginfo_2, 2);
diff -r a9bc744352e6 -r f142fd0e199f lib/libc/arch/sh5/sys/__sigaction14_sigtramp.c
--- a/lib/libc/arch/sh5/sys/__sigaction14_sigtramp.c    Tue Mar 23 16:13:27 2004 +0000
+++ b/lib/libc/arch/sh5/sys/__sigaction14_sigtramp.c    Tue Mar 23 16:19:40 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: __sigaction14_sigtramp.c,v 1.4 2003/10/05 10:01:49 scw Exp $   */
+/*     $NetBSD: __sigaction14_sigtramp.c,v 1.5 2004/03/23 16:19:41 drochner Exp $      */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -64,10 +64,12 @@
         * set in the sigaction.
         */
        if ((act->sa_flags & SA_SIGINFO) == 0) {
+               int sav = errno;
                rv =  __sigaction_sigtramp(sig, act, oact,
                    __sigtramp_sigcontext_1, 1);
                if (rv >= 0 || errno != EINVAL)
                        return rv;
+               errno = sav;
        }
 
        /*
diff -r a9bc744352e6 -r f142fd0e199f lib/libc/arch/sparc/sys/__sigaction14_sigtramp.c
--- a/lib/libc/arch/sparc/sys/__sigaction14_sigtramp.c  Tue Mar 23 16:13:27 2004 +0000
+++ b/lib/libc/arch/sparc/sys/__sigaction14_sigtramp.c  Tue Mar 23 16:19:40 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: __sigaction14_sigtramp.c,v 1.3 2003/10/12 14:42:03 pk Exp $    */
+/*     $NetBSD: __sigaction14_sigtramp.c,v 1.4 2004/03/23 16:19:41 drochner Exp $      */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -58,6 +58,7 @@
         * is not set in the sigaction.
         */
        if (act && (act->sa_flags & SA_SIGINFO) == 0) {
+               int sav = errno;
                rv =  __sigaction_sigtramp(sig, act, oact,
                                           __sigtramp_sigcontext_1, 1);
                /*
@@ -67,6 +68,7 @@
                 */
                if (rv >= 0 || errno != EINVAL)
                        return rv;
+               errno = sav;
        }
 
        return __sigaction_sigtramp(sig, act, oact, __sigtramp_siginfo_2, 2);
diff -r a9bc744352e6 -r f142fd0e199f lib/libc/arch/sparc64/sys/__sigaction14_sigtramp.c
--- a/lib/libc/arch/sparc64/sys/__sigaction14_sigtramp.c        Tue Mar 23 16:13:27 2004 +0000
+++ b/lib/libc/arch/sparc64/sys/__sigaction14_sigtramp.c        Tue Mar 23 16:19:40 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: __sigaction14_sigtramp.c,v 1.3 2003/10/27 00:45:36 christos Exp $      */
+/*     $NetBSD: __sigaction14_sigtramp.c,v 1.4 2004/03/23 16:19:41 drochner Exp $      */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -58,6 +58,7 @@
         * is not set in the sigaction.
         */
        if (act && (act->sa_flags & SA_SIGINFO) == 0) {
+               int sav = errno;
                rv =  __sigaction_sigtramp(sig, act, oact,
                                           __sigtramp_sigcontext_1, 1);
                /*
@@ -67,6 +68,7 @@
                 */
                if (rv >= 0 || errno != EINVAL)
                        return rv;
+               errno = sav;
        }
 
        return __sigaction_sigtramp(sig, act, oact, __sigtramp_siginfo_2, 2);
diff -r a9bc744352e6 -r f142fd0e199f lib/libc/arch/vax/sys/__sigaction14_sigtramp.c
--- a/lib/libc/arch/vax/sys/__sigaction14_sigtramp.c    Tue Mar 23 16:13:27 2004 +0000
+++ b/lib/libc/arch/vax/sys/__sigaction14_sigtramp.c    Tue Mar 23 16:19:40 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: __sigaction14_sigtramp.c,v 1.4 2003/09/30 19:05:41 matt Exp $  */
+/*     $NetBSD: __sigaction14_sigtramp.c,v 1.5 2004/03/23 16:19:41 drochner Exp $      */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -65,10 +65,12 @@
         * set in the sigaction.
         */
        if ((act->sa_flags & SA_SIGINFO) == 0) {
+               int sav = errno;
                rv =  __sigaction_sigtramp(sig, act, oact,
                    __sigtramp_sigcontext_2, 2);
                if (rv >= 0 || errno != EINVAL)
                        return rv;
+               errno = sav;
        }
 
        /*
diff -r a9bc744352e6 -r f142fd0e199f lib/libc/arch/x86_64/sys/__sigaction14_sigtramp.c
--- a/lib/libc/arch/x86_64/sys/__sigaction14_sigtramp.c Tue Mar 23 16:13:27 2004 +0000
+++ b/lib/libc/arch/x86_64/sys/__sigaction14_sigtramp.c Tue Mar 23 16:19:40 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: __sigaction14_sigtramp.c,v 1.5 2003/10/18 20:11:04 briggs Exp $        */
+/*     $NetBSD: __sigaction14_sigtramp.c,v 1.6 2004/03/23 16:19:41 drochner Exp $      */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -66,10 +66,12 @@
         * set in the sigaction.
         */
        if ((act->sa_flags & SA_SIGINFO) == 0) {
+               int sav = errno;
                rv =  __sigaction_sigtramp(sig, act, oact,
                    __sigtramp_sigcontext_1, 1);
                if (rv >= 0 || errno != EINVAL)
                        return rv;
+               errno = sav;
        }
 
        /*



Home | Main Index | Thread Index | Old Index