early-access version 2281

This commit is contained in:
pineappleEA
2021-12-07 02:20:09 +01:00
parent c2ae6d480a
commit c4fa174d53
591 changed files with 36978 additions and 18653 deletions

View File

@@ -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);