rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | Subject: port android_reboot() to call the reboot syscall via syscall() (glibc) rather than __reboot (bionic) |
| 2 | Author: Loïc Minier <loic.minier@ubuntu.com> |
| 3 | |
| 4 | --- a/core/libcutils/android_reboot.c |
| 5 | +++ b/core/libcutils/android_reboot.c |
| 6 | @@ -21,6 +21,8 @@ |
| 7 | #include <fcntl.h> |
| 8 | #include <stdio.h> |
| 9 | #include <string.h> |
| 10 | +#include <linux/reboot.h> |
| 11 | +#include <sys/syscall.h> |
| 12 | |
| 13 | #include <cutils/android_reboot.h> |
| 14 | |
| 15 | @@ -121,8 +123,8 @@ |
| 16 | break; |
| 17 | |
| 18 | case ANDROID_RB_RESTART2: |
| 19 | - ret = __reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, |
| 20 | - LINUX_REBOOT_CMD_RESTART2, arg); |
| 21 | + ret = syscall(SYS_reboot, LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, |
| 22 | + LINUX_REBOOT_CMD_RESTART2, arg); |
| 23 | break; |
| 24 | |
| 25 | default: |