aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2011-01-04 18:50:51 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2011-01-04 18:50:51 -0800
commit8bc6fb3433c76428d2fffb83be8902052644fca2 (patch)
tree1fbc742262aa33a989a585d0349db53a1c3fa624
parent512405a421fa69a7a003854d9270cd109b026267 (diff)
parentbf10797e538f9fa252d72710bd5ecf0ef1f6f3e0 (diff)
downloadsystem_core-8bc6fb3433c76428d2fffb83be8902052644fca2.tar.gz
system_core-8bc6fb3433c76428d2fffb83be8902052644fca2.tar.bz2
system_core-8bc6fb3433c76428d2fffb83be8902052644fca2.zip
am bf10797e: am f7ca6040: Fix infinite loop in init when debugging is turned off
* commit 'bf10797e538f9fa252d72710bd5ecf0ef1f6f3e0': Fix infinite loop in init when debugging is turned off
-rw-r--r--init/keychords.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/init/keychords.c b/init/keychords.c
index 892cbdf8..aab08195 100644
--- a/init/keychords.c
+++ b/init/keychords.c
@@ -105,14 +105,14 @@ void handle_keychord()
// and on user builds for users that are developers.
debuggable = property_get("ro.debuggable");
adb_enabled = property_get("init.svc.adbd");
+ ret = read(keychord_fd, &id, sizeof(id));
+ if (ret != sizeof(id)) {
+ ERROR("could not read keychord id\n");
+ return;
+ }
+
if ((debuggable && !strcmp(debuggable, "1")) ||
(adb_enabled && !strcmp(adb_enabled, "running"))) {
- ret = read(keychord_fd, &id, sizeof(id));
- if (ret != sizeof(id)) {
- ERROR("could not read keychord id\n");
- return;
- }
-
svc = service_find_by_keychord(id);
if (svc) {
INFO("starting service %s from keychord\n", svc->name);