mirror of
https://github.com/troglobit/finit.git
synced 2026-11-16 19:20:26 +00:00
Change poweroff method to reboot(RB_POWER_OFF) (Metalshark)
Metalshark says: February 19th, 2008 at 9:10 pm There is an issue with some ACPI/Kernel combinations to do with shutdown. It isn’t always powering off (tried /proc/acpi and /sys methods) - however removing all the fd > 5 stuff and putting in the simple line “reboot(RB_POWER_OFF);” worked for all thus far. Although semantically incorrect it is a working solution. Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
This commit is contained in:
1 parent
7137573534
commit
fb8c341168
3 files changed
+7
-14
No files matched your search
+1
-6
@@ -328,8 +328,6 @@ int main()
|
||||
*/
|
||||
void shutdown(int sig)
|
||||
{
|
||||
int fd;
|
||||
|
||||
debug("shutdown");
|
||||
touch("/tmp/shutdown");
|
||||
|
||||
@@ -354,10 +352,7 @@ void shutdown(int sig)
|
||||
if (sig == SIGINT || sig == SIGUSR1)
|
||||
reboot(RB_AUTOBOOT);
|
||||
|
||||
if ((fd = open("/sys/power/state", O_WRONLY)) >= 0) {
|
||||
write(fd, "5", 1);
|
||||
close(fd);
|
||||
}
|
||||
reboot(RB_POWER_OFF);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user