Make g_udev_mon static

This commit is contained in:
twinaphex 2015-11-30 16:47:43 +01:00
parent b76481b21e
commit 28602d84af
4 changed files with 10 additions and 5 deletions

View File

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

View File

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

View File

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

View File

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