summaryrefslogtreecommitdiffstats
path: root/reboot
diff options
context:
space:
mode:
authorMark Salyzyn2017-09-11 17:22:57 -0500
committerMark Salyzyn2017-09-12 14:24:02 -0500
commit277eca138b3cb5cc7e922483575799835f07e22c (patch)
tree6b3a4e59929ebcf0964324ecb98e86a52fa13fd4 /reboot
parentb304f6d4e7752e08519a96aeaa936e36492afdc9 (diff)
downloadplatform-system-core-277eca138b3cb5cc7e922483575799835f07e22c.tar.gz
platform-system-core-277eca138b3cb5cc7e922483575799835f07e22c.tar.xz
platform-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')
-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[])
56 56
57 if (argc > optind) 57 if (argc > optind)
58 optarg = argv[optind]; 58 optarg = argv[optind];
59 if (!optarg || !optarg[0]) optarg = "shell";
59 60
60 prop_len = snprintf(property_val, sizeof(property_val), "%s,%s", cmd, optarg); 61 prop_len = snprintf(property_val, sizeof(property_val), "%s,%s", cmd, optarg);
61 if (prop_len >= sizeof(property_val)) { 62 if (prop_len >= sizeof(property_val)) {