diff options
author | Nick Kralevich <nnk@google.com> | 2013-10-24 12:39:29 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-10-24 12:39:29 -0700 |
commit | 0bf7924df19f72258df7b553515bfbc9574d0114 (patch) | |
tree | 4d28393e229d9ab93f546803c699637496c3c9d5 | |
parent | 396f6b7771688c5aeb72138fff4d9415e31ae1da (diff) | |
parent | 917045222a69021eb36aea96708649c709685509 (diff) | |
download | system_core-0bf7924df19f72258df7b553515bfbc9574d0114.zip system_core-0bf7924df19f72258df7b553515bfbc9574d0114.tar.gz system_core-0bf7924df19f72258df7b553515bfbc9574d0114.tar.bz2 |
am 91704522: Don\'t return immediately from reboot commands.
* commit '917045222a69021eb36aea96708649c709685509':
Don't return immediately from reboot commands.
-rw-r--r-- | adb/services.c | 4 | ||||
-rw-r--r-- | reboot/reboot.c | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/adb/services.c b/adb/services.c index f0d5878..951048e 100644 --- a/adb/services.c +++ b/adb/services.c @@ -144,7 +144,11 @@ void reboot_service(int fd, void *arg) if (ret < 0) { snprintf(buf, sizeof(buf), "reboot failed: %d\n", ret); writex(fd, buf, strlen(buf)); + goto cleanup; } + // Don't return early. Give the reboot command time to take effect + // to avoid messing up scripts which do "adb reboot && adb wait-for-device" + while(1) { pause(); } cleanup: free(arg); adb_close(fd); diff --git a/reboot/reboot.c b/reboot/reboot.c index 0e5170d..d9a4227 100644 --- a/reboot/reboot.c +++ b/reboot/reboot.c @@ -68,6 +68,11 @@ int main(int argc, char *argv[]) perror("reboot"); exit(EXIT_FAILURE); } + + // Don't return early. Give the reboot command time to take effect + // to avoid messing up scripts which do "adb shell reboot && adb wait-for-device" + while(1) { pause(); } + fprintf(stderr, "Done\n"); return 0; } |