mirror of
https://github.com/libretro/RetroArch
synced 2025-02-19 12:41:00 +00:00
Make g_udev_mon static
This commit is contained in:
parent
b76481b21e
commit
28602d84af
@ -5,7 +5,7 @@
|
||||
#include "udev_common.h"
|
||||
|
||||
static bool udev_mon_inited;
|
||||
struct udev_monitor *g_udev_mon;
|
||||
static struct udev_monitor *g_udev_mon;
|
||||
struct udev *g_udev;
|
||||
|
||||
bool udev_mon_new(void)
|
||||
@ -56,3 +56,8 @@ bool udev_mon_hotplug_available(void)
|
||||
|
||||
return (poll(&fds, 1, 0) == 1) && (fds.revents & POLLIN);
|
||||
}
|
||||
|
||||
struct udev_device *udev_mon_receive_device(void)
|
||||
{
|
||||
return udev_monitor_receive_device(g_udev_mon);
|
||||
}
|
||||
|
@ -21,7 +21,6 @@
|
||||
|
||||
#include <boolean.h>
|
||||
|
||||
extern struct udev_monitor *g_udev_mon;
|
||||
extern struct udev *g_udev;
|
||||
|
||||
bool udev_mon_new(void);
|
||||
@ -30,4 +29,6 @@ void udev_mon_free(bool is_joypad);
|
||||
|
||||
bool udev_mon_hotplug_available(void);
|
||||
|
||||
struct udev_device *udev_mon_receive_device(void);
|
||||
|
||||
#endif
|
||||
|
@ -24,7 +24,6 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <sys/poll.h>
|
||||
#include <sys/epoll.h>
|
||||
|
||||
#include <libudev.h>
|
||||
@ -306,7 +305,7 @@ static void udev_input_handle_hotplug(udev_input_t *udev)
|
||||
const char *val_touchpad = NULL;
|
||||
const char *action = NULL;
|
||||
const char *devnode = NULL;
|
||||
struct udev_device *dev = udev_monitor_receive_device(g_udev_mon);
|
||||
struct udev_device *dev = udev_mon_receive_device();
|
||||
|
||||
if (!dev)
|
||||
return;
|
||||
|
@ -397,7 +397,7 @@ static void udev_joypad_handle_hotplug(void)
|
||||
const char *val;
|
||||
const char *action;
|
||||
const char *devnode;
|
||||
struct udev_device *dev = udev_monitor_receive_device(g_udev_mon);
|
||||
struct udev_device *dev = udev_mon_receive_device();
|
||||
if (!dev)
|
||||
return;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user