[enable udev support]), [enable_udev=${enableval}])
if (test "${enable_udev}" = "yes"); then
AC_DEFINE(HAVE_UDEV, 1, [Define if udev support is available])
+ AC_CHECK_LIB(udev, udev_monitor_receive_device, dummy=yes,
+ AC_DEFINE(NEED_UDEV_MONITOR_RECEIVE_DEVICE, 1,
+ [Define to 1 if you need the
+ udev_monitor_receive_device() function.]))
+ AC_CHECK_LIB(udev, udev_device_get_action, dummy=yes,
+ AC_DEFINE(NEED_UDEV_DEVICE_GET_ACTION, 1,
+ [Define to 1 if you need the
+ udev_device_get_action() function.]))
PKG_CHECK_MODULES(UDEV, libudev >= 127, enable_udev=yes,
AC_MSG_ERROR(udev >= 127 is required))
fi
#include "connman.h"
+#ifdef NEED_UDEV_MONITOR_RECEIVE_DEVICE
+static struct udev_device *udev_monitor_receive_device(struct udev_monitor *monitor);
+{
+ return udev_monitor_get_device(monitor);
+}
+#endif
+
+#ifdef NEED_UDEV_DEVICE_GET_ACTION
+static const char *udev_device_get_action(struct udev_device *device)
+{
+ return NULL;
+}
+#endif
+
static gboolean udev_event(GIOChannel *channel,
GIOCondition condition, gpointer user_data)
{
struct udev_monitor *monitor = user_data;
struct udev_device *device;
- const char *action, *sysname;
+ const char *action;
device = udev_monitor_receive_device(monitor);
if (device == NULL)
action = udev_device_get_action(device);
if (action == NULL)
- return TRUE;
+ goto done;
- sysname = udev_device_get_sysname(device);
+ connman_debug("=== %s ===", action);
- DBG("%s %s", action, sysname);
+done:
+ udev_device_unref(device);
return TRUE;
}