Source-Changes-HG archive

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

[src/trunk]: src/sys/kern handle errors from loading the syscalls and bail ea...



details:   https://anonhg.NetBSD.org/src/rev/895e5718462d
branches:  trunk
changeset: 838317:895e5718462d
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Jan 10 22:02:16 2019 +0000

description:
handle errors from loading the syscalls and bail early. establish sysctl
later.

diffstat:

 sys/kern/sysv_ipc.c |  28 +++++++++++++++-------------
 1 files changed, 15 insertions(+), 13 deletions(-)

diffs (71 lines):

diff -r b0b3fe942bc5 -r 895e5718462d sys/kern/sysv_ipc.c
--- a/sys/kern/sysv_ipc.c       Thu Jan 10 19:00:17 2019 +0000
+++ b/sys/kern/sysv_ipc.c       Thu Jan 10 22:02:16 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sysv_ipc.c,v 1.33 2018/09/03 16:29:35 riastradh Exp $  */
+/*     $NetBSD: sysv_ipc.c,v 1.34 2019/01/10 22:02:16 christos Exp $   */
 
 /*-
  * Copyright (c) 1998, 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sysv_ipc.c,v 1.33 2018/09/03 16:29:35 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sysv_ipc.c,v 1.34 2019/01/10 22:02:16 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sysv.h"
@@ -195,15 +195,12 @@
                /* Set up the kauth listener */
                sysvipcinit();
 
-#ifdef _MODULE
-               /* Set up the common sysctl tree */
-               sysctl_ipc_setup(&sysctl_sysvipc_clog);
-#endif
-
                /* Link the system calls */
                error = syscall_establish(NULL, sysvipc_syscalls);
-               if (error)
+               if (error) {
                        sysvipcfini();
+                       return error;
+               }
 
                /*
                 * Initialize each sub-component, including their
@@ -218,6 +215,11 @@
 #ifdef SYSVMSG
                msginit(&sysctl_sysvipc_clog);
 #endif
+
+#ifdef _MODULE
+               /* Set up the common sysctl tree */
+               sysctl_ipc_setup(&sysctl_sysvipc_clog);
+#endif
                break;
        case MODULE_CMD_FINI:
                /*
@@ -253,16 +255,16 @@
                }
 #endif
 
+#ifdef _MODULE
+               /* Remove the sysctl sub-trees */
+               sysctl_teardown(&sysctl_sysvipc_clog);
+#endif
+
                /* Unlink the system calls. */
                error = syscall_disestablish(NULL, sysvipc_syscalls);
                if (error)
                        return error;
 
-#ifdef _MODULE
-               /* Remove the sysctl sub-trees */
-               sysctl_teardown(&sysctl_sysvipc_clog);
-#endif
-
                /* Remove the kauth listener */
                sysvipcfini();
                break;



Home | Main Index | Thread Index | Old Index