Removed local constants in favor of using syscalls already defined exported constants

pull/152/head
Brad Ward 2015-12-20 00:56:36 +00:00
rodzic ee7804d124
commit 1c9a3a2ce2
1 zmienionych plików z 3 dodań i 5 usunięć

Wyświetl plik

@ -219,7 +219,7 @@ func handleSettingsSetRequest(w http.ResponseWriter, r *http.Request) {
log.Printf("handleSettingsSetRequest:json: unrecognized key:%s\n", key)
}
}
saveSettings()
saveSettings()
}
}
@ -230,16 +230,14 @@ func handleSettingsSetRequest(w http.ResponseWriter, r *http.Request) {
}
func handleShutdownRequest(w http.ResponseWriter, r *http.Request) {
const LINUX_REBOOT_CMD_POWER_OFF= 0x4321FEDC
syscall.Sync()
syscall.Reboot(LINUX_REBOOT_CMD_POWER_OFF)
syscall.Reboot(syscall.LINUX_REBOOT_CMD_POWER_OFF)
}
func handleRebootRequest(w http.ResponseWriter, r *http.Request) {
const LINUX_REBOOT_CMD_RESTART = 0x01234567
syscall.Sync()
syscall.Reboot(LINUX_REBOOT_CMD_RESTART)
syscall.Reboot(syscall.LINUX_REBOOT_CMD_RESTART)
}