summaryrefslogtreecommitdiffstats
path: root/reboot.c
diff options
context:
space:
mode:
authorDees_Troy <dees_troy@teamw.in>2012-09-27 15:49:29 +0200
committerDees_Troy <dees_troy@teamw.in>2012-09-27 15:50:56 +0200
commita58beade0a4f5342f5dcd3b3a597f9183de92260 (patch)
tree62bfd10e4fc279cc4decc7fd96a0e6a86d710008 /reboot.c
parentDisplay symlinks and block devices in file manager (diff)
downloadandroid_bootable_recovery-a58beade0a4f5342f5dcd3b3a597f9183de92260.tar
android_bootable_recovery-a58beade0a4f5342f5dcd3b3a597f9183de92260.tar.gz
android_bootable_recovery-a58beade0a4f5342f5dcd3b3a597f9183de92260.tar.bz2
android_bootable_recovery-a58beade0a4f5342f5dcd3b3a597f9183de92260.tar.lz
android_bootable_recovery-a58beade0a4f5342f5dcd3b3a597f9183de92260.tar.xz
android_bootable_recovery-a58beade0a4f5342f5dcd3b3a597f9183de92260.tar.zst
android_bootable_recovery-a58beade0a4f5342f5dcd3b3a597f9183de92260.zip
Diffstat (limited to '')
-rw-r--r--reboot.c71
1 files changed, 0 insertions, 71 deletions
diff --git a/reboot.c b/reboot.c
deleted file mode 100644
index 9d87ff21d..000000000
--- a/reboot.c
+++ /dev/null
@@ -1,71 +0,0 @@
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/reboot.h>
-//#include <reboot/reboot.h>
-#include <unistd.h>
-
-#include "tw_reboot.h"
-#include "recovery_ui.h"
-#include "roots.h"
-#include "extra-functions.h"
-#include "data.h"
-#include "variables.h"
-
-// isRebootCommandSupported: Return 1 if command is supported, 0 if the command is not supported, -1 on error
-int tw_isRebootCommandSupported(RebootCommand command)
-{
- switch (command)
- {
- case rb_system:
- case rb_recovery:
- case rb_poweroff:
- case rb_bootloader:
- case rb_download:
- return 1;
-
- default:
- return 0;
- }
- return -1;
-}
-
-// setRebootMode: Set the reboot state (without rebooting). Return 0 on success, -1 on error or unsupported
-int tw_setRebootMode(RebootCommand command)
-{
- return -1;
-}
-
-// reboot: Reboot the system. Return -1 on error, no return on success
-int tw_reboot(RebootCommand command)
-{
- // Always force a sync before we reboot
- sync();
-
- switch (command)
- {
- case rb_current:
- case rb_system:
- twfinish_recovery("s");
- sync();
- check_and_run_script("/sbin/rebootsystem.sh", "reboot system");
- return reboot(RB_AUTOBOOT);
- case rb_recovery:
- check_and_run_script("/sbin/rebootrecovery.sh", "reboot recovery");
- return __reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, LINUX_REBOOT_CMD_RESTART2, (void*) "recovery");
- case rb_bootloader:
- check_and_run_script("/sbin/rebootbootloader.sh", "reboot bootloader");
- return __reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, LINUX_REBOOT_CMD_RESTART2, (void*) "bootloader");
- case rb_poweroff:
- check_and_run_script("/sbin/poweroff.sh", "power off");
- return reboot(RB_POWER_OFF);
- case rb_download:
- check_and_run_script("/sbin/rebootdownload.sh", "reboot download");
- return __reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, LINUX_REBOOT_CMD_RESTART2, (void*) "download");
- return 1;
- default:
- return -1;
- }
- return -1;
-}
-