early-access version 2281
This commit is contained in:
4
externals/SDL/src/power/haiku/SDL_syspower.c
vendored
4
externals/SDL/src/power/haiku/SDL_syspower.c
vendored
@@ -45,7 +45,7 @@
|
||||
SDL_bool
|
||||
SDL_GetPowerInfo_Haiku(SDL_PowerState * state, int *seconds, int *percent)
|
||||
{
|
||||
const int fd = open("/dev/misc/apm", O_RDONLY);
|
||||
const int fd = open("/dev/misc/apm", O_RDONLY | O_CLOEXEC);
|
||||
SDL_bool need_details = SDL_FALSE;
|
||||
uint16 regs[6];
|
||||
uint8 ac_status;
|
||||
@@ -59,7 +59,7 @@ SDL_GetPowerInfo_Haiku(SDL_PowerState * state, int *seconds, int *percent)
|
||||
return SDL_FALSE; /* maybe some other method will work? */
|
||||
}
|
||||
|
||||
memset(regs, '\0', sizeof(regs));
|
||||
SDL_memset(regs, '\0', sizeof(regs));
|
||||
regs[0] = APM_FUNC_OFFSET + APM_FUNC_GET_POWER_STATUS;
|
||||
regs[1] = APM_DEVICE_ALL;
|
||||
rc = ioctl(fd, APM_BIOS_CALL, regs);
|
||||
|
Reference in New Issue
Block a user