]> err.no Git - systemd/commitdiff
loginctl: use new udev_device_has_tag() call from libudev where applicable
authorLennart Poettering <lennart@poettering.net>
Wed, 13 Jul 2011 18:11:23 +0000 (20:11 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 13 Jul 2011 18:11:23 +0000 (20:11 +0200)
configure.ac
src/logind-dbus.c
src/logind.h
src/sysfs-show.c

index 46d8eebbdfe1d09fe63baa4cd2dc5e798dd806a8..787a0a82c4093b78fc58cac72dd988cab8338fba 100644 (file)
@@ -117,7 +117,7 @@ AC_CHECK_HEADERS([sys/capability.h], [], [AC_MSG_ERROR([*** POSIX caps headers n
 # This makes sure pkg.m4 is available.
 m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
 
-PKG_CHECK_MODULES(UDEV, [ libudev >= 160 ])
+PKG_CHECK_MODULES(UDEV, [ libudev >= 172 ])
 AC_SUBST(UDEV_CFLAGS)
 AC_SUBST(UDEV_LIBS)
 
index 16dbd3664ca2eb9b0cd65306d423f336dd4e4aef..e0855f4cf82fc616b965335c821204189da3f86d 100644 (file)
@@ -550,23 +550,6 @@ fail:
         return r;
 }
 
-static bool device_has_tag(struct udev_device *d, const char *tag) {
-        struct udev_list_entry *first, *item;
-
-        assert(d);
-        assert(tag);
-
-        /* FIXME */
-        udev_device_get_is_initialized(d);
-
-        first = udev_device_get_tags_list_entry(d);
-        udev_list_entry_foreach(item, first)
-                if (streq(udev_list_entry_get_name(item), tag))
-                        return true;
-
-        return false;
-}
-
 static int trigger_device(Manager *m, const char *prefix) {
         struct udev_enumerate *e;
         struct udev_list_entry *first, *item;
@@ -628,7 +611,7 @@ static int attach_device(Manager *m, const char *seat, const char *sysfs) {
         if (!d)
                 return -ENODEV;
 
-        if (!device_has_tag(d, "seat")) {
+        if (!udev_device_has_tag(d, "seat")) {
                 r = -ENODEV;
                 goto finish;
         }
index db20bff194c35b72077c83e73574092611fcc401..cdb612805f6e4111c00869d59ef51f7d091d2583 100644 (file)
@@ -38,8 +38,6 @@
  * direct client API
  *
  * udev:
- * drop redundant udev_device_get_is_initialized() use as soon as libudev is fixed
- * use device_has_tag() as soon as it is available
  * enumerate recursively with libudev when triggering
  * use sysfs in device hash table, not sysname, when fb driver is fixed
  *
index b456bf1271c730c45097533c452116f28c819515..ab866a470755235aaaec899e1c5e433453fbdff6 100644 (file)
 #include "util.h"
 #include "sysfs-show.h"
 
-static bool device_has_tag(struct udev_device *d, const char *tag) {
-        struct udev_list_entry *first, *item;
-
-        assert(d);
-        assert(tag);
-
-        /* FIXME */
-        udev_device_get_is_initialized(d);
-
-        first = udev_device_get_tags_list_entry(d);
-        udev_list_entry_foreach(item, first)
-                if (streq(udev_list_entry_get_name(item), tag))
-                        return true;
-
-        return false;
-}
-
 static int show_sysfs_one(
                 struct udev *udev,
                 const char *seat,
@@ -77,7 +60,7 @@ static int show_sysfs_one(
                         sn = "seat0";
 
                 /* fixme, also check for tag 'seat' here */
-                if (!streq(seat, sn) || !device_has_tag(d, "seat")) {
+                if (!streq(seat, sn) || !udev_device_has_tag(d, "seat")) {
                         udev_device_unref(d);
                         *item = udev_list_entry_get_next(*item);
                         continue;
@@ -109,7 +92,7 @@ static int show_sysfs_one(
                                         if (isempty(lookahead_sn))
                                                 lookahead_sn = "seat0";
 
-                                        found = streq(seat, lookahead_sn) && device_has_tag(lookahead_d, "seat");
+                                        found = streq(seat, lookahead_sn) && udev_device_has_tag(lookahead_d, "seat");
                                         udev_device_unref(lookahead_d);
 
                                         if (found)