diff options
| author | Glenn L McGrath <bug1@ihug.co.nz> | 2002-08-22 18:22:10 +0000 |
|---|---|---|
| committer | Glenn L McGrath <bug1@ihug.co.nz> | 2002-08-22 18:22:10 +0000 |
| commit | baf55a85fc08ddad71b43a2348fd4f58338be83f (patch) | |
| tree | 79f3dc09fb7bb5cfc43fc5698731bfa2906bf46f /init | |
| parent | e3906fcd94f9ec7e58337d4241f6ffa95e4fd847 (diff) | |
| download | busybox-w32-baf55a85fc08ddad71b43a2348fd4f58338be83f.tar.gz busybox-w32-baf55a85fc08ddad71b43a2348fd4f58338be83f.tar.bz2 busybox-w32-baf55a85fc08ddad71b43a2348fd4f58338be83f.zip | |
Run through indent, fix comments
Diffstat (limited to 'init')
| -rw-r--r-- | init/init.c | 265 |
1 files changed, 139 insertions, 126 deletions
diff --git a/init/init.c b/init/init.c index 333fba5dc..569e7e460 100644 --- a/init/init.c +++ b/init/init.c | |||
| @@ -55,36 +55,36 @@ | |||
| 55 | 55 | ||
| 56 | /* From <linux/vt.h> */ | 56 | /* From <linux/vt.h> */ |
| 57 | struct vt_stat { | 57 | struct vt_stat { |
| 58 | unsigned short v_active; /* active vt */ | 58 | unsigned short v_active; /* active vt */ |
| 59 | unsigned short v_signal; /* signal to send */ | 59 | unsigned short v_signal; /* signal to send */ |
| 60 | unsigned short v_state; /* vt bitmask */ | 60 | unsigned short v_state; /* vt bitmask */ |
| 61 | }; | 61 | }; |
| 62 | static const int VT_GETSTATE = 0x5603; /* get global vt state info */ | 62 | static const int VT_GETSTATE = 0x5603; /* get global vt state info */ |
| 63 | 63 | ||
| 64 | /* From <linux/serial.h> */ | 64 | /* From <linux/serial.h> */ |
| 65 | struct serial_struct { | 65 | struct serial_struct { |
| 66 | int type; | 66 | int type; |
| 67 | int line; | 67 | int line; |
| 68 | int port; | 68 | int port; |
| 69 | int irq; | 69 | int irq; |
| 70 | int flags; | 70 | int flags; |
| 71 | int xmit_fifo_size; | 71 | int xmit_fifo_size; |
| 72 | int custom_divisor; | 72 | int custom_divisor; |
| 73 | int baud_base; | 73 | int baud_base; |
| 74 | unsigned short close_delay; | 74 | unsigned short close_delay; |
| 75 | char reserved_char[2]; | 75 | char reserved_char[2]; |
| 76 | int hub6; | 76 | int hub6; |
| 77 | unsigned short closing_wait; /* time to wait before closing */ | 77 | unsigned short closing_wait; /* time to wait before closing */ |
| 78 | unsigned short closing_wait2; /* no longer used... */ | 78 | unsigned short closing_wait2; /* no longer used... */ |
| 79 | int reserved[4]; | 79 | int reserved[4]; |
| 80 | }; | 80 | }; |
| 81 | 81 | ||
| 82 | 82 | ||
| 83 | #if (__GNU_LIBRARY__ > 5) || defined(__dietlibc__) | 83 | #if (__GNU_LIBRARY__ > 5) || defined(__dietlibc__) |
| 84 | #include <sys/reboot.h> | 84 | #include <sys/reboot.h> |
| 85 | #define init_reboot(magic) reboot(magic) | 85 | #define init_reboot(magic) reboot(magic) |
| 86 | #else | 86 | #else |
| 87 | #define init_reboot(magic) reboot(0xfee1dead, 672274793, magic) | 87 | #define init_reboot(magic) reboot(0xfee1dead, 672274793, magic) |
| 88 | #endif | 88 | #endif |
| 89 | 89 | ||
| 90 | #ifndef _PATH_STDPATH | 90 | #ifndef _PATH_STDPATH |
| @@ -106,16 +106,16 @@ struct serial_struct { | |||
| 106 | #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) | 106 | #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) |
| 107 | 107 | ||
| 108 | #if __GNU_LIBRARY__ > 5 | 108 | #if __GNU_LIBRARY__ > 5 |
| 109 | #include <sys/kdaemon.h> | 109 | #include <sys/kdaemon.h> |
| 110 | #else | 110 | #else |
| 111 | extern int bdflush (int func, long int data); | 111 | extern int bdflush(int func, long int data); |
| 112 | #endif | 112 | #endif |
| 113 | 113 | ||
| 114 | #define SHELL "/bin/sh" /* Default shell */ | 114 | #define SHELL "/bin/sh" /* Default shell */ |
| 115 | #define LOGIN_SHELL "-" SHELL /* Default login shell */ | 115 | #define LOGIN_SHELL "-" SHELL /* Default login shell */ |
| 116 | #define INITTAB "/etc/inittab" /* inittab file location */ | 116 | #define INITTAB "/etc/inittab" /* inittab file location */ |
| 117 | #ifndef INIT_SCRIPT | 117 | #ifndef INIT_SCRIPT |
| 118 | #define INIT_SCRIPT "/etc/init.d/rcS" /* Default sysinit script. */ | 118 | #define INIT_SCRIPT "/etc/init.d/rcS" /* Default sysinit script. */ |
| 119 | #endif | 119 | #endif |
| 120 | 120 | ||
| 121 | #define MAXENV 16 /* Number of env. vars */ | 121 | #define MAXENV 16 /* Number of env. vars */ |
| @@ -159,15 +159,17 @@ struct init_action { | |||
| 159 | 159 | ||
| 160 | /* Static variables */ | 160 | /* Static variables */ |
| 161 | static struct init_action *init_action_list = NULL; | 161 | static struct init_action *init_action_list = NULL; |
| 162 | static int kernelVersion = 0; | 162 | static int kernelVersion = 0; |
| 163 | static char termType[32] = "TERM=linux"; | 163 | static char termType[32] = "TERM=linux"; |
| 164 | static char console[32] = _PATH_CONSOLE; | 164 | static char console[32] = _PATH_CONSOLE; |
| 165 | |||
| 165 | #ifndef CONFIG_SYSLOGD | 166 | #ifndef CONFIG_SYSLOGD |
| 166 | static char *log = VC_5; | 167 | static char *log = VC_5; |
| 167 | #endif | 168 | #endif |
| 168 | static sig_atomic_t got_cont = 0; | 169 | static sig_atomic_t got_cont = 0; |
| 169 | static const int LOG = 0x1; | 170 | static const int LOG = 0x1; |
| 170 | static const int CONSOLE = 0x2; | 171 | static const int CONSOLE = 0x2; |
| 172 | |||
| 171 | #if defined CONFIG_FEATURE_EXTRA_QUIET | 173 | #if defined CONFIG_FEATURE_EXTRA_QUIET |
| 172 | static const int MAYBE_CONSOLE = 0x0; | 174 | static const int MAYBE_CONSOLE = 0x0; |
| 173 | #else | 175 | #else |
| @@ -177,6 +179,7 @@ static const int MAYBE_CONSOLE = 0x0; | |||
| 177 | static const int RB_HALT_SYSTEM = 0xcdef0123; | 179 | static const int RB_HALT_SYSTEM = 0xcdef0123; |
| 178 | static const int RB_ENABLE_CAD = 0x89abcdef; | 180 | static const int RB_ENABLE_CAD = 0x89abcdef; |
| 179 | static const int RB_DISABLE_CAD = 0; | 181 | static const int RB_DISABLE_CAD = 0; |
| 182 | |||
| 180 | #define RB_POWER_OFF 0x4321fedc | 183 | #define RB_POWER_OFF 0x4321fedc |
| 181 | static const int RB_AUTOBOOT = 0x01234567; | 184 | static const int RB_AUTOBOOT = 0x01234567; |
| 182 | #endif | 185 | #endif |
| @@ -189,17 +192,20 @@ static int waitfor(struct init_action *a); | |||
| 189 | static void loop_forever(void) | 192 | static void loop_forever(void) |
| 190 | { | 193 | { |
| 191 | while (1) | 194 | while (1) |
| 192 | sleep (1); | 195 | sleep(1); |
| 193 | } | 196 | } |
| 194 | 197 | ||
| 195 | /* Print a message to the specified device. | 198 | /* Print a message to the specified device. |
| 196 | * Device may be bitwise-or'd from LOG | CONSOLE */ | 199 | * Device may be bitwise-or'd from LOG | CONSOLE */ |
| 197 | #ifdef DEBUG_INIT | 200 | #ifdef DEBUG_INIT |
| 198 | static inline messageND(int device, char *fmt, ...) { } | 201 | static inline messageND(int device, char *fmt, ...) |
| 199 | #else | 202 | { |
| 203 | } | ||
| 204 | #else | ||
| 200 | #define messageND message | 205 | #define messageND message |
| 201 | #endif | 206 | #endif |
| 202 | static void message(int device, char *fmt, ...) __attribute__ ((format (printf, 2, 3))); | 207 | static void message(int device, char *fmt, ...) |
| 208 | __attribute__ ((format(printf, 2, 3))); | ||
| 203 | static void message(int device, char *fmt, ...) | 209 | static void message(int device, char *fmt, ...) |
| 204 | { | 210 | { |
| 205 | va_list arguments; | 211 | va_list arguments; |
| @@ -222,7 +228,7 @@ static void message(int device, char *fmt, ...) | |||
| 222 | /* Take full control of the log tty, and never close it. | 228 | /* Take full control of the log tty, and never close it. |
| 223 | * It's mine, all mine! Muhahahaha! */ | 229 | * It's mine, all mine! Muhahahaha! */ |
| 224 | if (log_fd < 0) { | 230 | if (log_fd < 0) { |
| 225 | if ((log_fd = device_open(log, O_RDWR|O_NDELAY)) < 0) { | 231 | if ((log_fd = device_open(log, O_RDWR | O_NDELAY)) < 0) { |
| 226 | log_fd = -2; | 232 | log_fd = -2; |
| 227 | fprintf(stderr, "Bummer, can't write to log on %s!\n", log); | 233 | fprintf(stderr, "Bummer, can't write to log on %s!\n", log); |
| 228 | device = CONSOLE; | 234 | device = CONSOLE; |
| @@ -237,9 +243,9 @@ static void message(int device, char *fmt, ...) | |||
| 237 | 243 | ||
| 238 | if (device & CONSOLE) { | 244 | if (device & CONSOLE) { |
| 239 | /* Always send console messages to /dev/console so people will see them. */ | 245 | /* Always send console messages to /dev/console so people will see them. */ |
| 240 | if ( | 246 | if ((fd = |
| 241 | (fd = | 247 | device_open(_PATH_CONSOLE, |
| 242 | device_open(_PATH_CONSOLE, O_WRONLY | O_NOCTTY | O_NDELAY)) >= 0) { | 248 | O_WRONLY | O_NOCTTY | O_NDELAY)) >= 0) { |
| 243 | va_start(arguments, fmt); | 249 | va_start(arguments, fmt); |
| 244 | vdprintf(fd, fmt, arguments); | 250 | vdprintf(fd, fmt, arguments); |
| 245 | va_end(arguments); | 251 | va_end(arguments); |
| @@ -261,21 +267,21 @@ static void set_term(int fd) | |||
| 261 | tcgetattr(fd, &tty); | 267 | tcgetattr(fd, &tty); |
| 262 | 268 | ||
| 263 | /* set control chars */ | 269 | /* set control chars */ |
| 264 | tty.c_cc[VINTR] = 3; /* C-c */ | 270 | tty.c_cc[VINTR] = 3; /* C-c */ |
| 265 | tty.c_cc[VQUIT] = 28; /* C-\ */ | 271 | tty.c_cc[VQUIT] = 28; /* C-\ */ |
| 266 | tty.c_cc[VERASE] = 127; /* C-? */ | 272 | tty.c_cc[VERASE] = 127; /* C-? */ |
| 267 | tty.c_cc[VKILL] = 21; /* C-u */ | 273 | tty.c_cc[VKILL] = 21; /* C-u */ |
| 268 | tty.c_cc[VEOF] = 4; /* C-d */ | 274 | tty.c_cc[VEOF] = 4; /* C-d */ |
| 269 | tty.c_cc[VSTART] = 17; /* C-q */ | 275 | tty.c_cc[VSTART] = 17; /* C-q */ |
| 270 | tty.c_cc[VSTOP] = 19; /* C-s */ | 276 | tty.c_cc[VSTOP] = 19; /* C-s */ |
| 271 | tty.c_cc[VSUSP] = 26; /* C-z */ | 277 | tty.c_cc[VSUSP] = 26; /* C-z */ |
| 272 | 278 | ||
| 273 | /* use line dicipline 0 */ | 279 | /* use line dicipline 0 */ |
| 274 | tty.c_line = 0; | 280 | tty.c_line = 0; |
| 275 | 281 | ||
| 276 | /* Make it be sane */ | 282 | /* Make it be sane */ |
| 277 | tty.c_cflag &= CBAUD|CBAUDEX|CSIZE|CSTOPB|PARENB|PARODD; | 283 | tty.c_cflag &= CBAUD | CBAUDEX | CSIZE | CSTOPB | PARENB | PARODD; |
| 278 | tty.c_cflag |= CREAD|HUPCL|CLOCAL; | 284 | tty.c_cflag |= CREAD | HUPCL | CLOCAL; |
| 279 | 285 | ||
| 280 | 286 | ||
| 281 | /* input modes */ | 287 | /* input modes */ |
| @@ -296,7 +302,7 @@ static void set_term(int fd) | |||
| 296 | static int check_free_memory(void) | 302 | static int check_free_memory(void) |
| 297 | { | 303 | { |
| 298 | struct sysinfo info; | 304 | struct sysinfo info; |
| 299 | unsigned int result, u, s=10; | 305 | unsigned int result, u, s = 10; |
| 300 | 306 | ||
| 301 | if (sysinfo(&info) != 0) { | 307 | if (sysinfo(&info) != 0) { |
| 302 | perror_msg("Error checking free memory"); | 308 | perror_msg("Error checking free memory"); |
| @@ -306,11 +312,16 @@ static int check_free_memory(void) | |||
| 306 | /* Kernels 2.0.x and 2.2.x return info.mem_unit==0 with values in bytes. | 312 | /* Kernels 2.0.x and 2.2.x return info.mem_unit==0 with values in bytes. |
| 307 | * Kernels 2.4.0 return info.mem_unit in bytes. */ | 313 | * Kernels 2.4.0 return info.mem_unit in bytes. */ |
| 308 | u = info.mem_unit; | 314 | u = info.mem_unit; |
| 309 | if (u==0) u=1; | 315 | if (u == 0) |
| 310 | while ( (u&1) == 0 && s > 0 ) { u>>=1; s--; } | 316 | u = 1; |
| 311 | result = (info.totalram>>s) + (info.totalswap>>s); | 317 | while ((u & 1) == 0 && s > 0) { |
| 312 | result = result*u; | 318 | u >>= 1; |
| 313 | if (result < 0) result = INT_MAX; | 319 | s--; |
| 320 | } | ||
| 321 | result = (info.totalram >> s) + (info.totalswap >> s); | ||
| 322 | result = result * u; | ||
| 323 | if (result < 0) | ||
| 324 | result = INT_MAX; | ||
| 314 | return result; | 325 | return result; |
| 315 | } | 326 | } |
| 316 | 327 | ||
| @@ -378,17 +389,18 @@ static void console_init(void) | |||
| 378 | if (ioctl(0, TIOCGSERIAL, &sr) == 0) { | 389 | if (ioctl(0, TIOCGSERIAL, &sr) == 0) { |
| 379 | /* Force the TERM setting to vt102 for serial console -- | 390 | /* Force the TERM setting to vt102 for serial console -- |
| 380 | * if TERM is set to linux (the default) */ | 391 | * if TERM is set to linux (the default) */ |
| 381 | if (strcmp( termType, "TERM=linux" ) == 0) | 392 | if (strcmp(termType, "TERM=linux") == 0) |
| 382 | safe_strncpy(termType, "TERM=vt102", sizeof(termType)); | 393 | safe_strncpy(termType, "TERM=vt102", sizeof(termType)); |
| 383 | } | 394 | } |
| 384 | close(fd); | 395 | close(fd); |
| 385 | } | 396 | } |
| 386 | message(LOG, "console=%s\n", console); | 397 | message(LOG, "console=%s\n", console); |
| 387 | } | 398 | } |
| 388 | 399 | ||
| 389 | static void fixup_argv(int argc, char **argv, char *new_argv0) | 400 | static void fixup_argv(int argc, char **argv, char *new_argv0) |
| 390 | { | 401 | { |
| 391 | int len; | 402 | int len; |
| 403 | |||
| 392 | /* Fix up argv[0] to be certain we claim to be init */ | 404 | /* Fix up argv[0] to be certain we claim to be init */ |
| 393 | len = strlen(argv[0]); | 405 | len = strlen(argv[0]); |
| 394 | memset(argv[0], 0, len); | 406 | memset(argv[0], 0, len); |
| @@ -425,8 +437,7 @@ static void check_memory(void) | |||
| 425 | #endif | 437 | #endif |
| 426 | 438 | ||
| 427 | goodnight: | 439 | goodnight: |
| 428 | message(CONSOLE, | 440 | message(CONSOLE, "\rSorry, your computer does not have enough memory.\n"); |
| 429 | "\rSorry, your computer does not have enough memory.\n"); | ||
| 430 | loop_forever(); | 441 | loop_forever(); |
| 431 | } | 442 | } |
| 432 | 443 | ||
| @@ -436,9 +447,9 @@ static pid_t run(struct init_action *a) | |||
| 436 | int i, j, junk; | 447 | int i, j, junk; |
| 437 | pid_t pid, pgrp, tmp_pid; | 448 | pid_t pid, pgrp, tmp_pid; |
| 438 | char *s, *tmpCmd, *cmd[INIT_BUFFS_SIZE], *cmdpath; | 449 | char *s, *tmpCmd, *cmd[INIT_BUFFS_SIZE], *cmdpath; |
| 439 | char buf[INIT_BUFFS_SIZE+6]; /* INIT_BUFFS_SIZE+strlen("exec ")+1 */ | 450 | char buf[INIT_BUFFS_SIZE + 6]; /* INIT_BUFFS_SIZE+strlen("exec ")+1 */ |
| 440 | sigset_t nmask, omask; | 451 | sigset_t nmask, omask; |
| 441 | char *environment[MAXENV+1] = { | 452 | char *environment[MAXENV + 1] = { |
| 442 | termType, | 453 | termType, |
| 443 | "HOME=/", | 454 | "HOME=/", |
| 444 | "PATH=" _PATH_STDPATH, | 455 | "PATH=" _PATH_STDPATH, |
| @@ -453,8 +464,8 @@ static pid_t run(struct init_action *a) | |||
| 453 | "\nPlease press Enter to activate this console. "; | 464 | "\nPlease press Enter to activate this console. "; |
| 454 | 465 | ||
| 455 | /* inherit environment to the child, merging our values -andy */ | 466 | /* inherit environment to the child, merging our values -andy */ |
| 456 | for (i=0; environ[i]; i++) { | 467 | for (i = 0; environ[i]; i++) { |
| 457 | for (j=0; environment[j]; j++) { | 468 | for (j = 0; environment[j]; j++) { |
| 458 | s = strchr(environment[j], '='); | 469 | s = strchr(environment[j], '='); |
| 459 | if (!strncmp(environ[i], environment[j], s - environment[j])) | 470 | if (!strncmp(environ[i], environment[j], s - environment[j])) |
| 460 | break; | 471 | break; |
| @@ -470,8 +481,7 @@ static pid_t run(struct init_action *a) | |||
| 470 | sigaddset(&nmask, SIGCHLD); | 481 | sigaddset(&nmask, SIGCHLD); |
| 471 | sigprocmask(SIG_BLOCK, &nmask, &omask); | 482 | sigprocmask(SIG_BLOCK, &nmask, &omask); |
| 472 | 483 | ||
| 473 | if ((pid = fork()) == 0) | 484 | if ((pid = fork()) == 0) { |
| 474 | { | ||
| 475 | /* Clean up */ | 485 | /* Clean up */ |
| 476 | close(0); | 486 | close(0); |
| 477 | close(1); | 487 | close(1); |
| @@ -481,20 +491,20 @@ static pid_t run(struct init_action *a) | |||
| 481 | /* Reset signal handlers that were set by the parent process */ | 491 | /* Reset signal handlers that were set by the parent process */ |
| 482 | signal(SIGUSR1, SIG_DFL); | 492 | signal(SIGUSR1, SIG_DFL); |
| 483 | signal(SIGUSR2, SIG_DFL); | 493 | signal(SIGUSR2, SIG_DFL); |
| 484 | signal(SIGINT, SIG_DFL); | 494 | signal(SIGINT, SIG_DFL); |
| 485 | signal(SIGTERM, SIG_DFL); | 495 | signal(SIGTERM, SIG_DFL); |
| 486 | signal(SIGHUP, SIG_DFL); | 496 | signal(SIGHUP, SIG_DFL); |
| 487 | signal(SIGCONT, SIG_DFL); | 497 | signal(SIGCONT, SIG_DFL); |
| 488 | signal(SIGSTOP, SIG_DFL); | 498 | signal(SIGSTOP, SIG_DFL); |
| 489 | signal(SIGTSTP, SIG_DFL); | 499 | signal(SIGTSTP, SIG_DFL); |
| 490 | 500 | ||
| 491 | /* Create a new session and make ourself the process | 501 | /* Create a new session and make ourself the process |
| 492 | * group leader for non-interactive jobs */ | 502 | * group leader for non-interactive jobs */ |
| 493 | if ((a->action & (RESPAWN))==0) | 503 | if ((a->action & (RESPAWN)) == 0) |
| 494 | setsid(); | 504 | setsid(); |
| 495 | 505 | ||
| 496 | /* Open the new terminal device */ | 506 | /* Open the new terminal device */ |
| 497 | if ((device_open(a->terminal, O_RDWR|O_NOCTTY)) < 0) { | 507 | if ((device_open(a->terminal, O_RDWR | O_NOCTTY)) < 0) { |
| 498 | if (stat(a->terminal, &sb) != 0) { | 508 | if (stat(a->terminal, &sb) != 0) { |
| 499 | message(LOG | CONSOLE, "\rdevice '%s' does not exist.\n", | 509 | message(LOG | CONSOLE, "\rdevice '%s' does not exist.\n", |
| 500 | a->terminal); | 510 | a->terminal); |
| @@ -505,8 +515,8 @@ static pid_t run(struct init_action *a) | |||
| 505 | } | 515 | } |
| 506 | 516 | ||
| 507 | /* Non-interactive jobs should not get a controling tty */ | 517 | /* Non-interactive jobs should not get a controling tty */ |
| 508 | if ((a->action & (RESPAWN))==0) | 518 | if ((a->action & (RESPAWN)) == 0) |
| 509 | (void)ioctl(0, TIOCSCTTY, 0); | 519 | (void) ioctl(0, TIOCSCTTY, 0); |
| 510 | 520 | ||
| 511 | /* Make sure the terminal will act fairly normal for us */ | 521 | /* Make sure the terminal will act fairly normal for us */ |
| 512 | set_term(0); | 522 | set_term(0); |
| @@ -522,7 +532,7 @@ static pid_t run(struct init_action *a) | |||
| 522 | 532 | ||
| 523 | /* If the init Action requires us to wait, then force the | 533 | /* If the init Action requires us to wait, then force the |
| 524 | * supplied terminal to be the controlling tty. */ | 534 | * supplied terminal to be the controlling tty. */ |
| 525 | if (a->action & (SYSINIT|WAIT|CTRLALTDEL|SHUTDOWN|RESTART)) { | 535 | if (a->action & (SYSINIT | WAIT | CTRLALTDEL | SHUTDOWN | RESTART)) { |
| 526 | 536 | ||
| 527 | /* Now fork off another process to just hang around */ | 537 | /* Now fork off another process to just hang around */ |
| 528 | if ((pid = fork()) < 0) { | 538 | if ((pid = fork()) < 0) { |
| @@ -539,8 +549,7 @@ static pid_t run(struct init_action *a) | |||
| 539 | signal(SIGCHLD, SIG_DFL); | 549 | signal(SIGCHLD, SIG_DFL); |
| 540 | 550 | ||
| 541 | /* Wait for child to exit */ | 551 | /* Wait for child to exit */ |
| 542 | while ((tmp_pid = waitpid(pid, &junk, 0)) != pid) | 552 | while ((tmp_pid = waitpid(pid, &junk, 0)) != pid); |
| 543 | ; | ||
| 544 | 553 | ||
| 545 | /* See if stealing the controlling tty back is necessary */ | 554 | /* See if stealing the controlling tty back is necessary */ |
| 546 | pgrp = tcgetpgrp(0); | 555 | pgrp = tcgetpgrp(0); |
| @@ -551,13 +560,13 @@ static pid_t run(struct init_action *a) | |||
| 551 | if ((pid = fork()) < 0) { | 560 | if ((pid = fork()) < 0) { |
| 552 | message(LOG | CONSOLE, "\rCan't fork!\n"); | 561 | message(LOG | CONSOLE, "\rCan't fork!\n"); |
| 553 | _exit(1); | 562 | _exit(1); |
| 554 | } | 563 | } |
| 555 | if (pid == 0) { | 564 | if (pid == 0) { |
| 556 | setsid(); | 565 | setsid(); |
| 557 | ioctl(0, TIOCSCTTY, 1); | 566 | ioctl(0, TIOCSCTTY, 1); |
| 558 | _exit(0); | 567 | _exit(0); |
| 559 | } | 568 | } |
| 560 | while((tmp_pid = waitpid(pid, &junk, 0)) != pid) { | 569 | while ((tmp_pid = waitpid(pid, &junk, 0)) != pid) { |
| 561 | if (tmp_pid < 0 && errno == ECHILD) | 570 | if (tmp_pid < 0 && errno == ECHILD) |
| 562 | break; | 571 | break; |
| 563 | } | 572 | } |
| @@ -578,8 +587,7 @@ static pid_t run(struct init_action *a) | |||
| 578 | /* Convert command (char*) into cmd (char**, one word per string) */ | 587 | /* Convert command (char*) into cmd (char**, one word per string) */ |
| 579 | strcpy(buf, a->command); | 588 | strcpy(buf, a->command); |
| 580 | s = buf; | 589 | s = buf; |
| 581 | for (tmpCmd = buf, i = 0; | 590 | for (tmpCmd = buf, i = 0; (tmpCmd = strsep(&s, " \t")) != NULL;) { |
| 582 | (tmpCmd = strsep(&s, " \t")) != NULL;) { | ||
| 583 | if (*tmpCmd != '\0') { | 591 | if (*tmpCmd != '\0') { |
| 584 | cmd[i] = tmpCmd; | 592 | cmd[i] = tmpCmd; |
| 585 | i++; | 593 | i++; |
| @@ -606,12 +614,12 @@ static pid_t run(struct init_action *a) | |||
| 606 | s = get_last_path_component(cmdpath); | 614 | s = get_last_path_component(cmdpath); |
| 607 | 615 | ||
| 608 | /* make a new argv[0] */ | 616 | /* make a new argv[0] */ |
| 609 | if ((cmd[0] = malloc(strlen(s)+2)) == NULL) { | 617 | if ((cmd[0] = malloc(strlen(s) + 2)) == NULL) { |
| 610 | message(LOG | CONSOLE, "malloc failed"); | 618 | message(LOG | CONSOLE, "malloc failed"); |
| 611 | cmd[0] = cmdpath; | 619 | cmd[0] = cmdpath; |
| 612 | } else { | 620 | } else { |
| 613 | cmd[0][0] = '-'; | 621 | cmd[0][0] = '-'; |
| 614 | strcpy(cmd[0]+1, s); | 622 | strcpy(cmd[0] + 1, s); |
| 615 | } | 623 | } |
| 616 | } | 624 | } |
| 617 | 625 | ||
| @@ -624,19 +632,21 @@ static pid_t run(struct init_action *a) | |||
| 624 | * be allowed to start a shell or whatever an init script | 632 | * be allowed to start a shell or whatever an init script |
| 625 | * specifies. | 633 | * specifies. |
| 626 | */ | 634 | */ |
| 627 | messageND(LOG, "Waiting for enter to start '%s' (pid %d, terminal %s)\n", | 635 | messageND(LOG, |
| 628 | cmdpath, getpid(), a->terminal); | 636 | "Waiting for enter to start '%s' (pid %d, terminal %s)\n", |
| 637 | cmdpath, getpid(), a->terminal); | ||
| 629 | write(fileno(stdout), press_enter, sizeof(press_enter) - 1); | 638 | write(fileno(stdout), press_enter, sizeof(press_enter) - 1); |
| 630 | getc(stdin); | 639 | getc(stdin); |
| 631 | } | 640 | } |
| 632 | 641 | ||
| 633 | /* Log the process name and args */ | 642 | /* Log the process name and args */ |
| 634 | messageND(LOG, "Starting pid %d, console %s: '%s'\n", | 643 | messageND(LOG, "Starting pid %d, console %s: '%s'\n", |
| 635 | getpid(), a->terminal, cmdpath); | 644 | getpid(), a->terminal, cmdpath); |
| 636 | 645 | ||
| 637 | #if defined CONFIG_FEATURE_INIT_COREDUMPS | 646 | #if defined CONFIG_FEATURE_INIT_COREDUMPS |
| 638 | if (stat (CORE_ENABLE_FLAG_FILE, &sb) == 0) { | 647 | if (stat(CORE_ENABLE_FLAG_FILE, &sb) == 0) { |
| 639 | struct rlimit limit; | 648 | struct rlimit limit; |
| 649 | |||
| 640 | limit.rlim_cur = RLIM_INFINITY; | 650 | limit.rlim_cur = RLIM_INFINITY; |
| 641 | limit.rlim_max = RLIM_INFINITY; | 651 | limit.rlim_max = RLIM_INFINITY; |
| 642 | setrlimit(RLIMIT_CORE, &limit); | 652 | setrlimit(RLIMIT_CORE, &limit); |
| @@ -658,7 +668,7 @@ static pid_t run(struct init_action *a) | |||
| 658 | 668 | ||
| 659 | static int waitfor(struct init_action *a) | 669 | static int waitfor(struct init_action *a) |
| 660 | { | 670 | { |
| 661 | int pid; | 671 | int pid; |
| 662 | int status, wpid; | 672 | int status, wpid; |
| 663 | 673 | ||
| 664 | pid = run(a); | 674 | pid = run(a); |
| @@ -681,13 +691,14 @@ static void run_actions(int action) | |||
| 681 | for (a = init_action_list; a; a = tmp) { | 691 | for (a = init_action_list; a; a = tmp) { |
| 682 | tmp = a->next; | 692 | tmp = a->next; |
| 683 | if (a->action == action) { | 693 | if (a->action == action) { |
| 684 | if (a->action & (SYSINIT|WAIT|CTRLALTDEL|SHUTDOWN|RESTART)) { | 694 | if (a-> |
| 695 | action & (SYSINIT | WAIT | CTRLALTDEL | SHUTDOWN | RESTART)) { | ||
| 685 | waitfor(a); | 696 | waitfor(a); |
| 686 | delete_init_action(a); | 697 | delete_init_action(a); |
| 687 | } else if (a->action & ONCE) { | 698 | } else if (a->action & ONCE) { |
| 688 | run(a); | 699 | run(a); |
| 689 | delete_init_action(a); | 700 | delete_init_action(a); |
| 690 | } else if (a->action & (RESPAWN|ASKFIRST)) { | 701 | } else if (a->action & (RESPAWN | ASKFIRST)) { |
| 691 | /* Only run stuff with pid==0. If they have | 702 | /* Only run stuff with pid==0. If they have |
| 692 | * a pid, that means it is still running */ | 703 | * a pid, that means it is still running */ |
| 693 | if (a->pid == 0) { | 704 | if (a->pid == 0) { |
| @@ -720,16 +731,16 @@ static void shutdown_system(void) | |||
| 720 | /* Allow Ctrl-Alt-Del to reboot system. */ | 731 | /* Allow Ctrl-Alt-Del to reboot system. */ |
| 721 | init_reboot(RB_ENABLE_CAD); | 732 | init_reboot(RB_ENABLE_CAD); |
| 722 | 733 | ||
| 723 | message(CONSOLE|LOG, "\n\rThe system is going down NOW !!\n"); | 734 | message(CONSOLE | LOG, "\n\rThe system is going down NOW !!\n"); |
| 724 | sync(); | 735 | sync(); |
| 725 | 736 | ||
| 726 | /* Send signals to every process _except_ pid 1 */ | 737 | /* Send signals to every process _except_ pid 1 */ |
| 727 | message(CONSOLE|LOG, "\rSending SIGTERM to all processes.\n"); | 738 | message(CONSOLE | LOG, "\rSending SIGTERM to all processes.\n"); |
| 728 | kill(-1, SIGTERM); | 739 | kill(-1, SIGTERM); |
| 729 | sleep(1); | 740 | sleep(1); |
| 730 | sync(); | 741 | sync(); |
| 731 | 742 | ||
| 732 | message(CONSOLE|LOG, "\rSending SIGKILL to all processes.\n"); | 743 | message(CONSOLE | LOG, "\rSending SIGKILL to all processes.\n"); |
| 733 | kill(-1, SIGKILL); | 744 | kill(-1, SIGKILL); |
| 734 | sleep(1); | 745 | sleep(1); |
| 735 | 746 | ||
| @@ -737,7 +748,7 @@ static void shutdown_system(void) | |||
| 737 | run_actions(SHUTDOWN); | 748 | run_actions(SHUTDOWN); |
| 738 | 749 | ||
| 739 | sync(); | 750 | sync(); |
| 740 | if (kernelVersion > 0 && kernelVersion <= KERNEL_VERSION(2,2,11)) { | 751 | if (kernelVersion > 0 && kernelVersion <= KERNEL_VERSION(2, 2, 11)) { |
| 741 | /* bdflush, kupdate not needed for kernels >2.2.11 */ | 752 | /* bdflush, kupdate not needed for kernels >2.2.11 */ |
| 742 | bdflush(1, 0); | 753 | bdflush(1, 0); |
| 743 | sync(); | 754 | sync(); |
| @@ -748,7 +759,7 @@ static void exec_signal(int sig) | |||
| 748 | { | 759 | { |
| 749 | struct init_action *a, *tmp; | 760 | struct init_action *a, *tmp; |
| 750 | sigset_t unblock_signals; | 761 | sigset_t unblock_signals; |
| 751 | 762 | ||
| 752 | for (a = init_action_list; a; a = tmp) { | 763 | for (a = init_action_list; a; a = tmp) { |
| 753 | tmp = a->next; | 764 | tmp = a->next; |
| 754 | if (a->action & RESTART) { | 765 | if (a->action & RESTART) { |
| @@ -767,11 +778,11 @@ static void exec_signal(int sig) | |||
| 767 | sigaddset(&unblock_signals, SIGTSTP); | 778 | sigaddset(&unblock_signals, SIGTSTP); |
| 768 | sigprocmask(SIG_UNBLOCK, &unblock_signals, NULL); | 779 | sigprocmask(SIG_UNBLOCK, &unblock_signals, NULL); |
| 769 | 780 | ||
| 770 | message(CONSOLE|LOG, "\rTrying to re-exec %s\n", a->command); | 781 | message(CONSOLE | LOG, "\rTrying to re-exec %s\n", a->command); |
| 771 | execl(a->command, a->command, NULL); | 782 | execl(a->command, a->command, NULL); |
| 772 | 783 | ||
| 773 | message(CONSOLE|LOG, "\rexec of '%s' failed: %s\n", | 784 | message(CONSOLE | LOG, "\rexec of '%s' failed: %s\n", |
| 774 | a->command, sys_errlist[errno]); | 785 | a->command, sys_errlist[errno]); |
| 775 | sync(); | 786 | sync(); |
| 776 | sleep(2); | 787 | sleep(2); |
| 777 | init_reboot(RB_HALT_SYSTEM); | 788 | init_reboot(RB_HALT_SYSTEM); |
| @@ -783,20 +794,20 @@ static void exec_signal(int sig) | |||
| 783 | static void halt_signal(int sig) | 794 | static void halt_signal(int sig) |
| 784 | { | 795 | { |
| 785 | shutdown_system(); | 796 | shutdown_system(); |
| 786 | message(CONSOLE|LOG, | 797 | message(CONSOLE | LOG, |
| 787 | #if #cpu(s390) | 798 | #if #cpu(s390) |
| 788 | /* Seems the s390 console is Wierd(tm). */ | 799 | /* Seems the s390 console is Wierd(tm). */ |
| 789 | "\rThe system is halted. You may reboot now.\n" | 800 | "\rThe system is halted. You may reboot now.\n" |
| 790 | #else | 801 | #else |
| 791 | "\rThe system is halted. Press Reset or turn off power\n" | 802 | "\rThe system is halted. Press Reset or turn off power\n" |
| 792 | #endif | 803 | #endif |
| 793 | ); | 804 | ); |
| 794 | sync(); | 805 | sync(); |
| 795 | 806 | ||
| 796 | /* allow time for last message to reach serial console */ | 807 | /* allow time for last message to reach serial console */ |
| 797 | sleep(2); | 808 | sleep(2); |
| 798 | 809 | ||
| 799 | if (sig == SIGUSR2 && kernelVersion >= KERNEL_VERSION(2,2,0)) | 810 | if (sig == SIGUSR2 && kernelVersion >= KERNEL_VERSION(2, 2, 0)) |
| 800 | init_reboot(RB_POWER_OFF); | 811 | init_reboot(RB_POWER_OFF); |
| 801 | else | 812 | else |
| 802 | init_reboot(RB_HALT_SYSTEM); | 813 | init_reboot(RB_HALT_SYSTEM); |
| @@ -807,7 +818,7 @@ static void halt_signal(int sig) | |||
| 807 | static void reboot_signal(int sig) | 818 | static void reboot_signal(int sig) |
| 808 | { | 819 | { |
| 809 | shutdown_system(); | 820 | shutdown_system(); |
| 810 | message(CONSOLE|LOG, "\rPlease stand by while rebooting the system.\n"); | 821 | message(CONSOLE | LOG, "\rPlease stand by while rebooting the system.\n"); |
| 811 | sync(); | 822 | sync(); |
| 812 | 823 | ||
| 813 | /* allow time for last message to reach serial console */ | 824 | /* allow time for last message to reach serial console */ |
| @@ -829,12 +840,13 @@ static void stop_handler(int sig) | |||
| 829 | int saved_errno = errno; | 840 | int saved_errno = errno; |
| 830 | 841 | ||
| 831 | got_cont = 0; | 842 | got_cont = 0; |
| 832 | while(!got_cont) pause(); | 843 | while (!got_cont) |
| 844 | pause(); | ||
| 833 | got_cont = 0; | 845 | got_cont = 0; |
| 834 | errno = saved_errno; | 846 | errno = saved_errno; |
| 835 | } | 847 | } |
| 836 | 848 | ||
| 837 | /* The SIGCONT handler */ | 849 | /* The SIGCONT handler */ |
| 838 | static void cont_handler(int sig) | 850 | static void cont_handler(int sig) |
| 839 | { | 851 | { |
| 840 | got_cont = 1; | 852 | got_cont = 1; |
| @@ -850,7 +862,7 @@ static void new_init_action(int action, char *command, char *cons) | |||
| 850 | cons = console; | 862 | cons = console; |
| 851 | 863 | ||
| 852 | /* do not run entries if console device is not available */ | 864 | /* do not run entries if console device is not available */ |
| 853 | if (access(cons, R_OK|W_OK)) | 865 | if (access(cons, R_OK | W_OK)) |
| 854 | return; | 866 | return; |
| 855 | if (strcmp(cons, "/dev/null") == 0 && (action & ASKFIRST)) | 867 | if (strcmp(cons, "/dev/null") == 0 && (action & ASKFIRST)) |
| 856 | return; | 868 | return; |
| @@ -862,7 +874,7 @@ static void new_init_action(int action, char *command, char *cons) | |||
| 862 | } | 874 | } |
| 863 | 875 | ||
| 864 | /* Append to the end of the list */ | 876 | /* Append to the end of the list */ |
| 865 | for (a = init_action_list; a && a->next; a = a->next) ; | 877 | for (a = init_action_list; a && a->next; a = a->next); |
| 866 | if (a) { | 878 | if (a) { |
| 867 | a->next = new_action; | 879 | a->next = new_action; |
| 868 | } else { | 880 | } else { |
| @@ -872,11 +884,11 @@ static void new_init_action(int action, char *command, char *cons) | |||
| 872 | new_action->action = action; | 884 | new_action->action = action; |
| 873 | strcpy(new_action->terminal, cons); | 885 | strcpy(new_action->terminal, cons); |
| 874 | new_action->pid = 0; | 886 | new_action->pid = 0; |
| 875 | // message(LOG|CONSOLE, "command='%s' action='%d' terminal='%s'\n", | 887 | /* message(LOG|CONSOLE, "command='%s' action='%d' terminal='%s'\n", |
| 876 | // new_action->command, new_action->action, new_action->terminal); | 888 | new_action->command, new_action->action, new_action->terminal); */ |
| 877 | } | 889 | } |
| 878 | 890 | ||
| 879 | static void delete_init_action(struct init_action * action) | 891 | static void delete_init_action(struct init_action *action) |
| 880 | { | 892 | { |
| 881 | struct init_action *a, *b = NULL; | 893 | struct init_action *a, *b = NULL; |
| 882 | 894 | ||
| @@ -899,12 +911,13 @@ static void delete_init_action(struct init_action * action) | |||
| 899 | * of "askfirst" shells). If CONFIG_FEATURE_USE_INITTAB | 911 | * of "askfirst" shells). If CONFIG_FEATURE_USE_INITTAB |
| 900 | * _is_ defined, but /etc/inittab is missing, this | 912 | * _is_ defined, but /etc/inittab is missing, this |
| 901 | * results in the same set of default behaviors. | 913 | * results in the same set of default behaviors. |
| 902 | * */ | 914 | */ |
| 903 | static void parse_inittab(void) | 915 | static void parse_inittab(void) |
| 904 | { | 916 | { |
| 905 | #ifdef CONFIG_FEATURE_USE_INITTAB | 917 | #ifdef CONFIG_FEATURE_USE_INITTAB |
| 906 | FILE *file; | 918 | FILE *file; |
| 907 | char buf[INIT_BUFFS_SIZE], lineAsRead[INIT_BUFFS_SIZE], tmpConsole[INIT_BUFFS_SIZE]; | 919 | char buf[INIT_BUFFS_SIZE], lineAsRead[INIT_BUFFS_SIZE], |
| 920 | tmpConsole[INIT_BUFFS_SIZE]; | ||
| 908 | char *id, *runlev, *action, *command, *eol; | 921 | char *id, *runlev, *action, *command, *eol; |
| 909 | const struct init_action_type *a = actions; | 922 | const struct init_action_type *a = actions; |
| 910 | int foundIt; | 923 | int foundIt; |
| @@ -989,7 +1002,7 @@ static void parse_inittab(void) | |||
| 989 | if (strcmp(a->name, action) == 0) { | 1002 | if (strcmp(a->name, action) == 0) { |
| 990 | if (*id != '\0') { | 1003 | if (*id != '\0') { |
| 991 | strcpy(tmpConsole, "/dev/"); | 1004 | strcpy(tmpConsole, "/dev/"); |
| 992 | strncat(tmpConsole, id, INIT_BUFFS_SIZE-6); | 1005 | strncat(tmpConsole, id, INIT_BUFFS_SIZE - 6); |
| 993 | id = tmpConsole; | 1006 | id = tmpConsole; |
| 994 | } | 1007 | } |
| 995 | new_init_action(a->action, command, id); | 1008 | new_init_action(a->action, command, id); |
| @@ -1006,7 +1019,7 @@ static void parse_inittab(void) | |||
| 1006 | } | 1019 | } |
| 1007 | fclose(file); | 1020 | fclose(file); |
| 1008 | return; | 1021 | return; |
| 1009 | #endif /* CONFIG_FEATURE_USE_INITTAB */ | 1022 | #endif /* CONFIG_FEATURE_USE_INITTAB */ |
| 1010 | } | 1023 | } |
| 1011 | 1024 | ||
| 1012 | 1025 | ||
| @@ -1020,31 +1033,30 @@ extern int init_main(int argc, char **argv) | |||
| 1020 | if (argc > 1 && !strcmp(argv[1], "-q")) { | 1033 | if (argc > 1 && !strcmp(argv[1], "-q")) { |
| 1021 | /* don't assume init's pid == 1 */ | 1034 | /* don't assume init's pid == 1 */ |
| 1022 | long *pid = find_pid_by_name("init"); | 1035 | long *pid = find_pid_by_name("init"); |
| 1023 | if (!pid || *pid<=0) { | 1036 | |
| 1037 | if (!pid || *pid <= 0) { | ||
| 1024 | pid = find_pid_by_name("linuxrc"); | 1038 | pid = find_pid_by_name("linuxrc"); |
| 1025 | if (!pid || *pid<=0) | 1039 | if (!pid || *pid <= 0) |
| 1026 | error_msg_and_die("no process killed"); | 1040 | error_msg_and_die("no process killed"); |
| 1027 | } | 1041 | } |
| 1028 | kill(*pid, SIGHUP); | 1042 | kill(*pid, SIGHUP); |
| 1029 | exit(0); | 1043 | exit(0); |
| 1030 | } | 1044 | } |
| 1031 | |||
| 1032 | #ifndef DEBUG_INIT | 1045 | #ifndef DEBUG_INIT |
| 1033 | /* Expect to be invoked as init with PID=1 or be invoked as linuxrc */ | 1046 | /* Expect to be invoked as init with PID=1 or be invoked as linuxrc */ |
| 1034 | if (getpid() != 1 | 1047 | if (getpid() != 1 |
| 1035 | #ifdef CONFIG_FEATURE_INITRD | 1048 | #ifdef CONFIG_FEATURE_INITRD |
| 1036 | && strstr(applet_name, "linuxrc") == NULL | 1049 | && strstr(applet_name, "linuxrc") == NULL |
| 1037 | #endif | 1050 | #endif |
| 1038 | ) | 1051 | ) { |
| 1039 | { | 1052 | show_usage(); |
| 1040 | show_usage(); | ||
| 1041 | } | 1053 | } |
| 1042 | /* Set up sig handlers -- be sure to | 1054 | /* Set up sig handlers -- be sure to |
| 1043 | * clear all of these in run() */ | 1055 | * clear all of these in run() */ |
| 1044 | signal(SIGHUP, exec_signal); | 1056 | signal(SIGHUP, exec_signal); |
| 1045 | signal(SIGUSR1, halt_signal); | 1057 | signal(SIGUSR1, halt_signal); |
| 1046 | signal(SIGUSR2, halt_signal); | 1058 | signal(SIGUSR2, halt_signal); |
| 1047 | signal(SIGINT, ctrlaltdel_signal); | 1059 | signal(SIGINT, ctrlaltdel_signal); |
| 1048 | signal(SIGTERM, reboot_signal); | 1060 | signal(SIGTERM, reboot_signal); |
| 1049 | signal(SIGCONT, cont_handler); | 1061 | signal(SIGCONT, cont_handler); |
| 1050 | signal(SIGSTOP, stop_handler); | 1062 | signal(SIGSTOP, stop_handler); |
| @@ -1066,8 +1078,8 @@ extern int init_main(int argc, char **argv) | |||
| 1066 | close(1); | 1078 | close(1); |
| 1067 | close(2); | 1079 | close(2); |
| 1068 | 1080 | ||
| 1069 | if(device_open(console, O_RDWR|O_NOCTTY)==0) { | 1081 | if (device_open(console, O_RDWR | O_NOCTTY) == 0) { |
| 1070 | set_term(0); | 1082 | set_term(0); |
| 1071 | close(0); | 1083 | close(0); |
| 1072 | } | 1084 | } |
| 1073 | 1085 | ||
| @@ -1075,10 +1087,10 @@ extern int init_main(int argc, char **argv) | |||
| 1075 | setsid(); | 1087 | setsid(); |
| 1076 | 1088 | ||
| 1077 | /* Make sure PATH is set to something sane */ | 1089 | /* Make sure PATH is set to something sane */ |
| 1078 | putenv("PATH="_PATH_STDPATH); | 1090 | putenv("PATH=" _PATH_STDPATH); |
| 1079 | 1091 | ||
| 1080 | /* Hello world */ | 1092 | /* Hello world */ |
| 1081 | message(MAYBE_CONSOLE|LOG, "\rinit started: %s\n", full_version); | 1093 | message(MAYBE_CONSOLE | LOG, "\rinit started: %s\n", full_version); |
| 1082 | 1094 | ||
| 1083 | /* Make sure there is enough memory to do something useful. */ | 1095 | /* Make sure there is enough memory to do something useful. */ |
| 1084 | check_memory(); | 1096 | check_memory(); |
| @@ -1118,7 +1130,8 @@ extern int init_main(int argc, char **argv) | |||
| 1118 | 1130 | ||
| 1119 | /* If there is nothing else to do, stop */ | 1131 | /* If there is nothing else to do, stop */ |
| 1120 | if (init_action_list == NULL) { | 1132 | if (init_action_list == NULL) { |
| 1121 | message(LOG | CONSOLE, "\rNo more tasks for init -- sleeping forever.\n"); | 1133 | message(LOG | CONSOLE, |
| 1134 | "\rNo more tasks for init -- sleeping forever.\n"); | ||
| 1122 | loop_forever(); | 1135 | loop_forever(); |
| 1123 | } | 1136 | } |
| 1124 | 1137 | ||
