diff options
| author | Elliott Hughes <enh@google.com> | 2019-04-02 18:47:51 -0700 |
|---|---|---|
| committer | android-build-merger <android-build-merger@google.com> | 2019-04-02 18:47:51 -0700 |
| commit | cf2f309cff92867262052ac99931116411760335 (patch) | |
| tree | a5f8aa88e9f4fd374c0fed3aab8ad3d44e114314 /libcutils | |
| parent | 4f0c63c4f22f7e6d008e895067e79b6f479a37a4 (diff) | |
| parent | e3ec16b9c6d2e2cd0f11efc96058386697f15770 (diff) | |
| download | system_core-cf2f309cff92867262052ac99931116411760335.tar.gz system_core-cf2f309cff92867262052ac99931116411760335.tar.bz2 system_core-cf2f309cff92867262052ac99931116411760335.zip | |
Merge "libcutils: android_reboot command should be unsigned."
am: e3ec16b9c6
Change-Id: Ib2b93b1a133687c2bf2ce7f486ce6c3ffba828d3
Diffstat (limited to 'libcutils')
| -rw-r--r-- | libcutils/android_reboot.cpp | 4 | ||||
| -rw-r--r-- | libcutils/include/cutils/android_reboot.h | 9 |
2 files changed, 5 insertions, 8 deletions
diff --git a/libcutils/android_reboot.cpp b/libcutils/android_reboot.cpp index ce41cd320..e0def711d 100644 --- a/libcutils/android_reboot.cpp +++ b/libcutils/android_reboot.cpp @@ -23,12 +23,12 @@ #define TAG "android_reboot" -int android_reboot(int cmd, int /*flags*/, const char* arg) { +int android_reboot(unsigned cmd, int /*flags*/, const char* arg) { int ret; const char* restart_cmd = NULL; char* prop_value; - switch (static_cast<unsigned>(cmd)) { + switch (cmd) { case ANDROID_RB_RESTART: // deprecated case ANDROID_RB_RESTART2: restart_cmd = "reboot"; diff --git a/libcutils/include/cutils/android_reboot.h b/libcutils/include/cutils/android_reboot.h index 99030eddd..cd27eef88 100644 --- a/libcutils/include/cutils/android_reboot.h +++ b/libcutils/include/cutils/android_reboot.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef __CUTILS_ANDROID_REBOOT_H__ -#define __CUTILS_ANDROID_REBOOT_H__ +#pragma once #include <sys/cdefs.h> @@ -36,10 +35,8 @@ __BEGIN_DECLS /* Reboot or shutdown the system. * This call uses ANDROID_RB_PROPERTY to request reboot to init process. * Due to that, process calling this should have proper selinux permission - * to write to the property. Otherwise, the call will fail. + * to write to the property or the call will fail. */ -int android_reboot(int cmd, int flags, const char *arg); +int android_reboot(unsigned cmd, int flags, const char* arg); __END_DECLS - -#endif /* __CUTILS_ANDROID_REBOOT_H__ */ |
