switch (mode) { case REBOOT: args[i++] = "-r"; break; case HALT: args[i++] = "-h"; break; case POWEROFF: args[i++] = "-h"; args[i++] = "-P"; break; }
The HALT case should pass the -H (called as halt) argument to shutdown, just as the POWEROFF case passes -P
}
The HALT case should pass the -H (called as halt) argument to shutdown, just as the POWEROFF case passes -P