diff options
author | Ken Sumrall <ksumrall@android.com> | 2011-10-26 16:56:00 -0700 |
---|---|---|
committer | Ken Sumrall <ksumrall@android.com> | 2011-10-26 16:58:27 -0700 |
commit | a286480f56012abdb4ef4ddab1c19a5c2316b7b8 (patch) | |
tree | bcc2169da254bec93d5c0a35b518f5d36b2d38c4 /init/init.c | |
parent | aa75df74db5beffd25821ed6c360c36197d7bac1 (diff) | |
download | core-a286480f56012abdb4ef4ddab1c19a5c2316b7b8.tar.gz core-a286480f56012abdb4ef4ddab1c19a5c2316b7b8.tar.bz2 core-a286480f56012abdb4ef4ddab1c19a5c2316b7b8.zip |
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
Diffstat (limited to 'init/init.c')
-rwxr-xr-x | init/init.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/init/init.c b/init/init.c index 7b4a963e0..d10ca478c 100755 --- a/init/init.c +++ b/init/init.c @@ -315,7 +315,11 @@ static void service_stop_or_reset(struct service *svc, int how) /* 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); |