| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: init.c,v 1.106 2015/06/16 23:18:55 christos Exp $ */ | | 1 | /* $NetBSD: init.c,v 1.107 2015/10/14 15:53:24 christos Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 1991, 1993 | | 4 | * Copyright (c) 1991, 1993 |
5 | * The Regents of the University of California. All rights reserved. | | 5 | * The Regents of the University of California. All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to Berkeley by | | 7 | * This code is derived from software contributed to Berkeley by |
8 | * Donn Seeley at Berkeley Software Design, Inc. | | 8 | * Donn Seeley at Berkeley Software Design, Inc. |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
| @@ -32,27 +32,27 @@ | | | @@ -32,27 +32,27 @@ |
32 | * SUCH DAMAGE. | | 32 | * SUCH DAMAGE. |
33 | */ | | 33 | */ |
34 | | | 34 | |
35 | #include <sys/cdefs.h> | | 35 | #include <sys/cdefs.h> |
36 | #ifndef lint | | 36 | #ifndef lint |
37 | __COPYRIGHT("@(#) Copyright (c) 1991, 1993\ | | 37 | __COPYRIGHT("@(#) Copyright (c) 1991, 1993\ |
38 | The Regents of the University of California. All rights reserved."); | | 38 | The Regents of the University of California. All rights reserved."); |
39 | #endif /* not lint */ | | 39 | #endif /* not lint */ |
40 | | | 40 | |
41 | #ifndef lint | | 41 | #ifndef lint |
42 | #if 0 | | 42 | #if 0 |
43 | static char sccsid[] = "@(#)init.c 8.2 (Berkeley) 4/28/95"; | | 43 | static char sccsid[] = "@(#)init.c 8.2 (Berkeley) 4/28/95"; |
44 | #else | | 44 | #else |
45 | __RCSID("$NetBSD: init.c,v 1.106 2015/06/16 23:18:55 christos Exp $"); | | 45 | __RCSID("$NetBSD: init.c,v 1.107 2015/10/14 15:53:24 christos Exp $"); |
46 | #endif | | 46 | #endif |
47 | #endif /* not lint */ | | 47 | #endif /* not lint */ |
48 | | | 48 | |
49 | #include <sys/param.h> | | 49 | #include <sys/param.h> |
50 | #include <sys/sysctl.h> | | 50 | #include <sys/sysctl.h> |
51 | #include <sys/wait.h> | | 51 | #include <sys/wait.h> |
52 | #include <sys/mman.h> | | 52 | #include <sys/mman.h> |
53 | #include <sys/stat.h> | | 53 | #include <sys/stat.h> |
54 | #include <sys/mount.h> | | 54 | #include <sys/mount.h> |
55 | #include <machine/cpu.h> | | 55 | #include <machine/cpu.h> |
56 | | | 56 | |
57 | #include <db.h> | | 57 | #include <db.h> |
58 | #include <errno.h> | | 58 | #include <errno.h> |
| @@ -100,29 +100,29 @@ static const struct timespec dtrtime = { | | | @@ -100,29 +100,29 @@ static const struct timespec dtrtime = { |
100 | #if defined(RESCUEDIR) | | 100 | #if defined(RESCUEDIR) |
101 | #define INIT_BSHELL RESCUEDIR "/sh" | | 101 | #define INIT_BSHELL RESCUEDIR "/sh" |
102 | #define INIT_MOUNT_MFS RESCUEDIR "/mount_mfs" | | 102 | #define INIT_MOUNT_MFS RESCUEDIR "/mount_mfs" |
103 | #define INIT_PATH RESCUEDIR ":" _PATH_STDPATH | | 103 | #define INIT_PATH RESCUEDIR ":" _PATH_STDPATH |
104 | #else | | 104 | #else |
105 | #define INIT_BSHELL _PATH_BSHELL | | 105 | #define INIT_BSHELL _PATH_BSHELL |
106 | #define INIT_MOUNT_MFS "/sbin/mount_mfs" | | 106 | #define INIT_MOUNT_MFS "/sbin/mount_mfs" |
107 | #define INIT_PATH _PATH_STDPATH | | 107 | #define INIT_PATH _PATH_STDPATH |
108 | #endif | | 108 | #endif |
109 | | | 109 | |
110 | static void handle(sig_t, ...); | | 110 | static void handle(sig_t, ...); |
111 | static void delset(sigset_t *, ...); | | 111 | static void delset(sigset_t *, ...); |
112 | | | 112 | |
113 | static void stall(const char *, ...) __printflike(1, 2); | | 113 | static void stall(const char *, ...) __sysloglike(1, 2); |
114 | static void warning(const char *, ...) __printflike(1, 2); | | 114 | static void warning(const char *, ...) __sysloglike(1, 2); |
115 | static void emergency(const char *, ...) __printflike(1, 2); | | 115 | static void emergency(const char *, ...) __sysloglike(1, 2); |
116 | __dead static void disaster(int); | | 116 | __dead static void disaster(int); |
117 | static void badsys(int); | | 117 | static void badsys(int); |
118 | | | 118 | |
119 | /* | | 119 | /* |
120 | * We really need a recursive typedef... | | 120 | * We really need a recursive typedef... |
121 | * The following at least guarantees that the return type of (*state_t)() | | 121 | * The following at least guarantees that the return type of (*state_t)() |
122 | * is sufficiently wide to hold a function pointer. | | 122 | * is sufficiently wide to hold a function pointer. |
123 | */ | | 123 | */ |
124 | typedef long (*state_func_t)(void); | | 124 | typedef long (*state_func_t)(void); |
125 | typedef state_func_t (*state_t)(void); | | 125 | typedef state_func_t (*state_t)(void); |
126 | | | 126 | |
127 | #define DEATH 'd' | | 127 | #define DEATH 'd' |
128 | #define SINGLE_USER 's' | | 128 | #define SINGLE_USER 's' |