summaryrefslogtreecommitdiffstats
path: root/reboot/reboot.c
diff options
context:
space:
mode:
authorMark Salyzyn <salyzyn@google.com>2017-09-11 15:22:57 -0700
committerMark Salyzyn <salyzyn@google.com>2017-09-12 12:24:02 -0700
commit277eca138b3cb5cc7e922483575799835f07e22c (patch)
tree6b3a4e59929ebcf0964324ecb98e86a52fa13fd4 /reboot/reboot.c
parentb304f6d4e7752e08519a96aeaa936e36492afdc9 (diff)
downloadsystem_core-277eca138b3cb5cc7e922483575799835f07e22c.tar.gz
system_core-277eca138b3cb5cc7e922483575799835f07e22c.tar.bz2
system_core-277eca138b3cb5cc7e922483575799835f07e22c.zip
adb: reboot: last boot command default
For reboot [reboot_arg] requests via either reboot or adb reboot, if reboot_arg is empty then report "shell" or "adb" respectively. Test: boot_reason_test.sh shell_reboot adb_reboot Bug: 63736262 Change-Id: Ie613d9e62db6a705885e4e7520aede27af3aa1b9
Diffstat (limited to 'reboot/reboot.c')
-rw-r--r--reboot/reboot.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/reboot/reboot.c b/reboot/reboot.c
index 007dfbaa4..f0cf40c89 100644
--- a/reboot/reboot.c
+++ b/reboot/reboot.c
@@ -56,6 +56,7 @@ int main(int argc, char *argv[])
if (argc > optind)
optarg = argv[optind];
+ if (!optarg || !optarg[0]) optarg = "shell";
prop_len = snprintf(property_val, sizeof(property_val), "%s,%s", cmd, optarg);
if (prop_len >= sizeof(property_val)) {