diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-07-19 14:29:18 +0200 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-07-19 14:29:18 +0200 |
| commit | 3ed181b7ac8e696cd28caf003ae9dcbeebc03757 (patch) | |
| tree | 5bd0019e71d7d00a93381e2935babfb92b2ce9b9 | |
| parent | 4abfc2642dcff669798364835f53c804b3d7bcef (diff) | |
| download | busybox-w32-3ed181b7ac8e696cd28caf003ae9dcbeebc03757.tar.gz busybox-w32-3ed181b7ac8e696cd28caf003ae9dcbeebc03757.tar.bz2 busybox-w32-3ed181b7ac8e696cd28caf003ae9dcbeebc03757.zip | |
init: make comment more understandable. no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| -rw-r--r-- | init/init.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/init/init.c b/init/init.c index ce264283a..35f64cf8a 100644 --- a/init/init.c +++ b/init/init.c | |||
| @@ -960,7 +960,6 @@ int init_main(int argc UNUSED_PARAM, char **argv) | |||
| 960 | bb_signals_recursive_norestart((1 << SIGHUP), record_signo); | 960 | bb_signals_recursive_norestart((1 << SIGHUP), record_signo); |
| 961 | 961 | ||
| 962 | /* Now run the looping stuff for the rest of forever. | 962 | /* Now run the looping stuff for the rest of forever. |
| 963 | * NB: if delayed signal happened, avoid blocking in wait(). | ||
| 964 | */ | 963 | */ |
| 965 | while (1) { | 964 | while (1) { |
| 966 | int maybe_WNOHANG; | 965 | int maybe_WNOHANG; |
| @@ -976,10 +975,11 @@ int init_main(int argc UNUSED_PARAM, char **argv) | |||
| 976 | maybe_WNOHANG |= check_delayed_sigs(); | 975 | maybe_WNOHANG |= check_delayed_sigs(); |
| 977 | 976 | ||
| 978 | /* Wait for any child process(es) to exit. | 977 | /* Wait for any child process(es) to exit. |
| 979 | * NB: "delayed" signals will also interrupt this wait(), | 978 | * |
| 980 | * bb_signals_recursive_norestart() set them up for that. | 979 | * If check_delayed_sigs above reported that a signal |
| 981 | * This guarantees we won't be stuck here | 980 | * was caught, wait will be nonblocking. This ensures |
| 982 | * till next orphan dies. | 981 | * that if SIGHUP has reloaded inittab, respawn and askfirst |
| 982 | * actions will not be delayed until next child death. | ||
| 983 | */ | 983 | */ |
| 984 | if (maybe_WNOHANG) | 984 | if (maybe_WNOHANG) |
| 985 | maybe_WNOHANG = WNOHANG; | 985 | maybe_WNOHANG = WNOHANG; |
| @@ -987,6 +987,9 @@ int init_main(int argc UNUSED_PARAM, char **argv) | |||
| 987 | pid_t wpid; | 987 | pid_t wpid; |
| 988 | struct init_action *a; | 988 | struct init_action *a; |
| 989 | 989 | ||
| 990 | /* If signals happen _in_ the wait, they interrupt it, | ||
| 991 | * bb_signals_recursive_norestart set them up that way | ||
| 992 | */ | ||
| 990 | wpid = waitpid(-1, NULL, maybe_WNOHANG); | 993 | wpid = waitpid(-1, NULL, maybe_WNOHANG); |
| 991 | if (wpid <= 0) | 994 | if (wpid <= 0) |
| 992 | break; | 995 | break; |
