aboutsummaryrefslogtreecommitdiffstats
path: root/executor/executor.cc
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2016-01-20 13:58:57 +0100
committerDmitry Vyukov <dvyukov@google.com>2016-01-20 13:58:57 +0100
commit8cff5843fb3bbbc1342cf3aafbff953f4477761f (patch)
tree4b0588bf60a8110f70cde42051a526021c496542 /executor/executor.cc
parentaa1b7fe3a884674848f5f5a8edb4a9ad981fcad2 (diff)
vm/adb: use a more reliable way to reboot devices
Diffstat (limited to 'executor/executor.cc')
-rw-r--r--executor/executor.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/executor/executor.cc b/executor/executor.cc
index f3ab3cde9..2cefbf66c 100644
--- a/executor/executor.cc
+++ b/executor/executor.cc
@@ -131,8 +131,13 @@ void cover_reset(thread_t* th);
uintptr_t cover_read(thread_t* th);
uintptr_t cover_dedup(thread_t* th, uintptr_t n);
-int main()
+int main(int argc, char** argv)
{
+ if (argc == 2 && strcmp(argv[1], "reboot") == 0) {
+ reboot(LINUX_REBOOT_CMD_RESTART);
+ return 0;
+ }
+
if (mmap(&input_data[0], kMaxInput, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, kInFd, 0) != &input_data[0])
fail("mmap of input file failed");
if (mmap(&output_data[0], kMaxOutput, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_FIXED, kOutFd, 0) != &output_data[0])