From 8cff5843fb3bbbc1342cf3aafbff953f4477761f Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Wed, 20 Jan 2016 13:58:57 +0100 Subject: vm/adb: use a more reliable way to reboot devices --- executor/executor.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'executor') 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]) -- cgit mrf-deployment