Merge "libcutils: android_reboot command should be unsigned." am: e3ec16b9c6
am: cf2f309cff
Change-Id: I15c19bc1d885fa368f2cb84fc33a79c1749f114f
This commit is contained in:
commit
ba78d39cdc
2 changed files with 5 additions and 8 deletions
|
|
@ -23,12 +23,12 @@
|
||||||
|
|
||||||
#define TAG "android_reboot"
|
#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;
|
int ret;
|
||||||
const char* restart_cmd = NULL;
|
const char* restart_cmd = NULL;
|
||||||
char* prop_value;
|
char* prop_value;
|
||||||
|
|
||||||
switch (static_cast<unsigned>(cmd)) {
|
switch (cmd) {
|
||||||
case ANDROID_RB_RESTART: // deprecated
|
case ANDROID_RB_RESTART: // deprecated
|
||||||
case ANDROID_RB_RESTART2:
|
case ANDROID_RB_RESTART2:
|
||||||
restart_cmd = "reboot";
|
restart_cmd = "reboot";
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __CUTILS_ANDROID_REBOOT_H__
|
#pragma once
|
||||||
#define __CUTILS_ANDROID_REBOOT_H__
|
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
|
|
||||||
|
|
@ -36,10 +35,8 @@ __BEGIN_DECLS
|
||||||
/* Reboot or shutdown the system.
|
/* Reboot or shutdown the system.
|
||||||
* This call uses ANDROID_RB_PROPERTY to request reboot to init process.
|
* This call uses ANDROID_RB_PROPERTY to request reboot to init process.
|
||||||
* Due to that, process calling this should have proper selinux permission
|
* 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
|
__END_DECLS
|
||||||
|
|
||||||
#endif /* __CUTILS_ANDROID_REBOOT_H__ */
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue