summaryrefslogtreecommitdiffstats
path: root/init/init.h
diff options
context:
space:
mode:
authorTom Cherry <tomcherry@google.com>2017-04-17 16:34:20 -0700
committerTom Cherry <tomcherry@google.com>2017-04-17 16:40:06 -0700
commit98ad32a967079be80a101458d8a29d7ecefbb547 (patch)
tree64c0d213fc7c4f81f1424aa601792c5628c2989b /init/init.h
parentb7826a74f246ac148c3f5c6ad73e3fc8728a0bfe (diff)
downloadsystem_core-98ad32a967079be80a101458d8a29d7ecefbb547.tar.gz
system_core-98ad32a967079be80a101458d8a29d7ecefbb547.tar.bz2
system_core-98ad32a967079be80a101458d8a29d7ecefbb547.zip
init: handle sys.powerctl immediately
Currently if a process sets the sys.powerctl property, init adds this property change into the event queue, just like any other property. The actual logic to shutdown the device is not executed until init gets to the action associated with the property change. This is bad for multiple reasons, but explicitly causes deadlock in the follow scenario: A service is started with `exec` or `exec_start` The same service sets sys.powerctl indicating to the system to shutdown The same service then waits infinitely In this case, init doesn't process any further commands until the exec service completes, including the command to reboot the device. This change causes init to immediately handle sys.powerctl and reboot the device regardless of the state of the event queue, wait for exec, or wait for property conditions. Bug: 37209359 Bug: 37415192 Test: Init reboots normally Test: Update verifier can reboot the system Change-Id: Iff2295aed970840f47e56c4bacc93001b791fa35
Diffstat (limited to 'init/init.h')
-rw-r--r--init/init.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/init/init.h b/init/init.h
index fe850efd7..1da335030 100644
--- a/init/init.h
+++ b/init/init.h
@@ -26,7 +26,7 @@ extern struct selabel_handle *sehandle_prop;
void handle_control_message(const std::string& msg, const std::string& arg);
-void property_changed(const char *name, const char *value);
+void property_changed(const std::string& name, const std::string& value);
void register_epoll_handler(int fd, void (*fn)());