From fb123f93f9f5ce42c8e5785d2f8e0edaf951740e Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Wed, 26 Mar 2014 19:21:20 +0000 Subject: Imported from /home/lorry/working-area/delta_VirtualBox/VirtualBox-4.3.10.tar.bz2. --- src/VBox/Runtime/r3/linux/RTSystemShutdown-linux.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/VBox/Runtime/r3/linux/RTSystemShutdown-linux.cpp') diff --git a/src/VBox/Runtime/r3/linux/RTSystemShutdown-linux.cpp b/src/VBox/Runtime/r3/linux/RTSystemShutdown-linux.cpp index a1da642c..e58365ac 100644 --- a/src/VBox/Runtime/r3/linux/RTSystemShutdown-linux.cpp +++ b/src/VBox/Runtime/r3/linux/RTSystemShutdown-linux.cpp @@ -47,20 +47,24 @@ RTDECL(int) RTSystemShutdown(RTMSINTERVAL cMsDelay, uint32_t fFlags, const char * Assemble the argument vector. */ int iArg = 0; - const char *apszArgs[5]; + const char *apszArgs[6]; + + RT_BZERO(apszArgs, sizeof(apszArgs)); apszArgs[iArg++] = "/sbin/shutdown"; switch (fFlags & RTSYSTEM_SHUTDOWN_ACTION_MASK) { case RTSYSTEM_SHUTDOWN_HALT: - apszArgs[iArg++] = "--halt"; + apszArgs[iArg++] = "-h"; + apszArgs[iArg++] = "-H"; break; case RTSYSTEM_SHUTDOWN_REBOOT: - apszArgs[iArg++] = "--reboot"; + apszArgs[iArg++] = "-r"; break; case RTSYSTEM_SHUTDOWN_POWER_OFF: case RTSYSTEM_SHUTDOWN_POWER_OFF_HALT: - apszArgs[iArg++] = "--poweroff"; + apszArgs[iArg++] = "-h"; + apszArgs[iArg++] = "-P"; break; } @@ -95,4 +99,3 @@ RTDECL(int) RTSystemShutdown(RTMSINTERVAL cMsDelay, uint32_t fFlags, const char } RT_EXPORT_SYMBOL(RTSystemShutdown); - -- cgit v1.2.1