diff options
| author | Elliott Hughes <enh@google.com> | 2015-04-25 01:10:57 +0000 | 
|---|---|---|
| committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-04-25 01:10:58 +0000 | 
| commit | b749be0bc36b3ae610aa05541581ef8cc5e484ee (patch) | |
| tree | 287f1a9d3fc833a4fcb10cd8ab6d3d29902f6c4d /init/init.cpp | |
| parent | 662baefbb7ceaf2f2502f4e7752d4a6d835f216a (diff) | |
| parent | 9042cae40b60f37294073b59744d04c18033a07c (diff) | |
| download | system_core-b749be0bc36b3ae610aa05541581ef8cc5e484ee.zip system_core-b749be0bc36b3ae610aa05541581ef8cc5e484ee.tar.gz system_core-b749be0bc36b3ae610aa05541581ef8cc5e484ee.tar.bz2 | |
Merge "Clean up init signal handling a little."
Diffstat (limited to 'init/init.cpp')
| -rw-r--r-- | init/init.cpp | 24 | 
1 files changed, 3 insertions, 21 deletions
| diff --git a/init/init.cpp b/init/init.cpp index da35a9d..dccd6a2 100644 --- a/init/init.cpp +++ b/init/init.cpp @@ -848,16 +848,6 @@ static int property_service_init_action(int nargs, char **args)      return 0;  } -static int signal_init_action(int nargs, char **args) -{ -    signal_init(); -    if (get_signal_fd() < 0) { -        ERROR("signal_init() failed\n"); -        exit(1); -    } -    return 0; -} -  static int queue_property_triggers_action(int nargs, char **args)  {      queue_all_property_triggers(); @@ -1061,13 +1051,12 @@ int main(int argc, char** argv) {      restorecon("/dev/__properties__");      restorecon_recursive("/sys"); +    signal_init(); +      property_load_boot_defaults();      init_parse_config_file("/init.rc"); -    // Setup signal handler before any exec command or we'll deadlock -    queue_builtin_action(signal_init_action, "signal_init"); -      action_for_each_trigger("early-init", action_add_queue_tail);      queue_builtin_action(wait_for_coldboot_done_action, "wait_for_coldboot_done"); @@ -1097,8 +1086,8 @@ int main(int argc, char** argv) {      // TODO: why do we only initialize ufds after execute_one_command and restart_processes?      size_t fd_count = 0;      struct pollfd ufds[3]; +    ufds[fd_count++] = { .fd = get_signal_fd(), .events = POLLIN, .revents = 0 };      bool property_set_fd_init = false; -    bool signal_fd_init = false;      bool keychord_fd_init = false;      for (;;) { @@ -1114,13 +1103,6 @@ int main(int argc, char** argv) {              fd_count++;              property_set_fd_init = true;          } -        if (!signal_fd_init && get_signal_fd() > 0) { -            ufds[fd_count].fd = get_signal_fd(); -            ufds[fd_count].events = POLLIN; -            ufds[fd_count].revents = 0; -            fd_count++; -            signal_fd_init = true; -        }          if (!keychord_fd_init && get_keychord_fd() > 0) {              ufds[fd_count].fd = get_keychord_fd();              ufds[fd_count].events = POLLIN; | 
