mirror of
https://github.com/Ryujinx/SDL.git
synced 2025-02-25 10:06:47 +00:00
Fixed build error on Linux if HAVE_INOTIFY isn't defined
Fixes https://github.com/libsdl-org/SDL/issues/5682
This commit is contained in:
parent
f9a9d3c8d4
commit
f7b774a7e0
|
@ -497,21 +497,6 @@ static void SteamControllerDisconnectedCallback(int device_instance)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_INOTIFY
|
|
||||||
#ifdef HAVE_INOTIFY_INIT1
|
|
||||||
static int SDL_inotify_init1(void) {
|
|
||||||
return inotify_init1(IN_NONBLOCK | IN_CLOEXEC);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
static int SDL_inotify_init1(void) {
|
|
||||||
int fd = inotify_init();
|
|
||||||
if (fd < 0) return -1;
|
|
||||||
fcntl(fd, F_SETFL, O_NONBLOCK);
|
|
||||||
fcntl(fd, F_SETFD, FD_CLOEXEC);
|
|
||||||
return fd;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
StrHasPrefix(const char *string, const char *prefix)
|
StrHasPrefix(const char *string, const char *prefix)
|
||||||
{
|
{
|
||||||
|
@ -566,6 +551,21 @@ IsJoystickDeviceNode(const char *node)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_INOTIFY
|
||||||
|
#ifdef HAVE_INOTIFY_INIT1
|
||||||
|
static int SDL_inotify_init1(void) {
|
||||||
|
return inotify_init1(IN_NONBLOCK | IN_CLOEXEC);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
static int SDL_inotify_init1(void) {
|
||||||
|
int fd = inotify_init();
|
||||||
|
if (fd < 0) return -1;
|
||||||
|
fcntl(fd, F_SETFL, O_NONBLOCK);
|
||||||
|
fcntl(fd, F_SETFD, FD_CLOEXEC);
|
||||||
|
return fd;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void
|
static void
|
||||||
LINUX_InotifyJoystickDetect(void)
|
LINUX_InotifyJoystickDetect(void)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue