Fix the class_reset command
The class_reset command used to reset services that had been set to
"disabled" in the init.rc file to a non-disabled state. Now, if the
service was originally set to "disabled", have the reset command set
it back to disabled. Otherwise, set it to the "reset" state as it
currently does.
Change-Id: I0c10582e46a8e443d4748d9d893ae762b19b653a
diff --git a/init/init.c b/init/init.c
index 7b4a963..d10ca47 100755
--- a/init/init.c
+++ b/init/init.c
@@ -315,7 +315,11 @@
/* if the service has not yet started, prevent
* it from auto-starting with its class
*/
- svc->flags |= how;
+ if (how == SVC_RESET) {
+ svc->flags |= (svc->flags & SVC_RC_DISABLED) ? SVC_DISABLED : SVC_RESET;
+ } else {
+ svc->flags |= how;
+ }
if (svc->pid) {
NOTICE("service '%s' is being killed\n", svc->name);