chiark / gitweb /
libudev: list - use bit flags for 'sort' and 'unique'
authorKay Sievers <kay.sievers@vrfy.org>
Sat, 23 Apr 2011 22:22:23 +0000 (00:22 +0200)
committerKay Sievers <kay.sievers@vrfy.org>
Sat, 23 Apr 2011 22:22:23 +0000 (00:22 +0200)
13 files changed:
Makefile.am
libudev/libudev-device-private.c
libudev/libudev-device.c
libudev/libudev-enumerate.c
libudev/libudev-list.c
libudev/libudev-monitor.c
libudev/libudev-private.h
libudev/libudev-queue.c
libudev/libudev.c
udev/udev-event.c
udev/udev-node.c
udev/udev-rules.c
udev/udevadm-monitor.c

index 5ddf83a..2aff45e 100644 (file)
@@ -35,7 +35,7 @@ DISTCHECK_HOOKS =
 # libudev
 # ------------------------------------------------------------------------------
 LIBUDEV_CURRENT=11
-LIBUDEV_REVISION=2
+LIBUDEV_REVISION=3
 LIBUDEV_AGE=11
 
 SUBDIRS += libudev/docs
index ee9e297..b78b6c9 100644 (file)
@@ -86,7 +86,7 @@ static bool device_has_info(struct udev_device *udev_device)
        if (udev_device_get_devlink_priority(udev_device) != 0)
                return true;
        udev_list_entry_foreach(list_entry, udev_device_get_properties_list_entry(udev_device))
-               if (udev_list_entry_get_flags(list_entry))
+               if (udev_list_entry_get_num(list_entry))
                        return true;
        if (udev_device_get_tags_list_entry(udev_device) != NULL)
                return true;
@@ -157,7 +157,7 @@ int udev_device_update_db(struct udev_device *udev_device)
                if (udev_device_get_usec_initialized(udev_device) > 0)
                        fprintf(f, "I:%llu\n", udev_device_get_usec_initialized(udev_device));
                udev_list_entry_foreach(list_entry, udev_device_get_properties_list_entry(udev_device)) {
-                       if (!udev_list_entry_get_flags(list_entry))
+                       if (!udev_list_entry_get_num(list_entry))
                                continue;
                        fprintf(f, "E:%s=%s\n",
                                udev_list_entry_get_name(list_entry),
index 0ef7260..ffde21a 100644 (file)
@@ -103,7 +103,7 @@ struct udev_list_entry *udev_device_add_property(struct udev_device *udev_device
                        udev_list_entry_delete(list_entry);
                return NULL;
        }
-       return udev_list_entry_add(udev_device->udev, &udev_device->properties_list, key, value, 1, 0);
+       return udev_list_entry_add(udev_device->udev, &udev_device->properties_list, key, value, UDEV_LIST_UNIQUE);
 }
 
 static struct udev_list_entry *udev_device_add_property_from_string(struct udev_device *udev_device, const char *property)
@@ -289,7 +289,7 @@ int udev_device_read_db(struct udev_device *udev_device, const char *dbfile)
                        break;
                case 'E':
                        entry = udev_device_add_property_from_string(udev_device, val);
-                       udev_list_entry_set_flags(entry, 1);
+                       udev_list_entry_set_num(entry, true);
                        break;
                case 'G':
                        udev_device_add_tag(udev_device, val);
@@ -1216,7 +1216,7 @@ const char *udev_device_get_sysattr_value(struct udev_device *udev_device, const
        util_strscpyl(path, sizeof(path), udev_device_get_syspath(udev_device), "/", sysattr, NULL);
        if (lstat(path, &statbuf) != 0) {
                dbg(udev_device->udev, "no attribute '%s', keep negative entry\n", path);
-               udev_list_entry_add(udev_device->udev, &udev_device->sysattr_value_list, sysattr, NULL, 0, 0);
+               udev_list_entry_add(udev_device->udev, &udev_device->sysattr_value_list, sysattr, NULL, 0);
                goto out;
        }
 
@@ -1240,7 +1240,7 @@ const char *udev_device_get_sysattr_value(struct udev_device *udev_device, const
                if (pos != NULL) {
                        pos = &pos[1];
                        dbg(udev_device->udev, "cache '%s' with link value '%s'\n", sysattr, pos);
-                       list_entry = udev_list_entry_add(udev_device->udev, &udev_device->sysattr_value_list, sysattr, pos, 0, 0);
+                       list_entry = udev_list_entry_add(udev_device->udev, &udev_device->sysattr_value_list, sysattr, pos, 0);
                        val = udev_list_entry_get_value(list_entry);
                }
 
@@ -1272,7 +1272,7 @@ const char *udev_device_get_sysattr_value(struct udev_device *udev_device, const
        value[size] = '\0';
        util_remove_trailing_chars(value, '\n');
        dbg(udev_device->udev, "'%s' has attribute value '%s'\n", path, value);
-       list_entry = udev_list_entry_add(udev_device->udev, &udev_device->sysattr_value_list, sysattr, value, 0, 0);
+       list_entry = udev_list_entry_add(udev_device->udev, &udev_device->sysattr_value_list, sysattr, value, 0);
        val = udev_list_entry_get_value(list_entry);
 out:
        return val;
@@ -1311,7 +1311,7 @@ static int udev_device_sysattr_list_read(struct udev_device *udev_device)
                        continue;
 
                udev_list_entry_add(udev_device->udev, &udev_device->sysattr_list,
-                                   dent->d_name, NULL, 0, 0);
+                                   dent->d_name, NULL, 0);
                num++;
        }
 
@@ -1419,11 +1419,11 @@ int udev_device_add_devlink(struct udev_device *udev_device, const char *devlink
        struct udev_list_entry *list_entry;
 
        udev_device->devlinks_uptodate = false;
-       list_entry = udev_list_entry_add(udev_device->udev, &udev_device->devlinks_list, devlink, NULL, 1, 0);
+       list_entry = udev_list_entry_add(udev_device->udev, &udev_device->devlinks_list, devlink, NULL, UDEV_LIST_UNIQUE);
        if (list_entry == NULL)
                return -ENOMEM;
        if (unique)
-               udev_list_entry_set_flags(list_entry, 1);
+               udev_list_entry_set_num(list_entry, true);
        return 0;
 }
 
@@ -1491,7 +1491,7 @@ int udev_device_add_tag(struct udev_device *udev_device, const char *tag)
        if (strchr(tag, ':') != NULL || strchr(tag, ' ') != NULL)
                return -EINVAL;
        udev_device->tags_uptodate = false;
-       if (udev_list_entry_add(udev_device->udev, &udev_device->tags_list, tag, NULL, 1, 0) != NULL)
+       if (udev_list_entry_add(udev_device->udev, &udev_device->tags_list, tag, NULL, UDEV_LIST_UNIQUE) != NULL)
                return 0;
        return -ENOMEM;
 }
index 6870bb6..018d89c 100644 (file)
@@ -295,24 +295,24 @@ struct udev_list_entry *udev_enumerate_get_list_entry(struct udev_enumerate *ude
                            strncmp(entry->syspath, move_later->syspath, move_later_prefix) != 0) {
 
                                udev_list_entry_add(udev_enumerate->udev, &udev_enumerate->devices_list,
-                                           move_later->syspath, NULL, 0, 0);
+                                           move_later->syspath, NULL, 0);
                                move_later = NULL;
                        }
 
                        udev_list_entry_add(udev_enumerate->udev, &udev_enumerate->devices_list,
-                                           entry->syspath, NULL, 0, 0);
+                                           entry->syspath, NULL, 0);
                }
 
                if (move_later)
                        udev_list_entry_add(udev_enumerate->udev, &udev_enumerate->devices_list,
-                                           move_later->syspath, NULL, 0, 0);
+                                           move_later->syspath, NULL, 0);
 
                /* add and cleanup delayed devices from end of list */
                for (i = max; i < udev_enumerate->devices_cur; i++) {
                        struct syspath *entry = &udev_enumerate->devices[i];
 
                        udev_list_entry_add(udev_enumerate->udev, &udev_enumerate->devices_list,
-                                           entry->syspath, NULL, 0, 0);
+                                           entry->syspath, NULL, 0);
                        free(entry->syspath);
                }
                udev_enumerate->devices_cur = max;
@@ -336,7 +336,7 @@ int udev_enumerate_add_match_subsystem(struct udev_enumerate *udev_enumerate, co
        if (subsystem == NULL)
                return 0;
        if (udev_list_entry_add(udev_enumerate_get_udev(udev_enumerate),
-                               &udev_enumerate->subsystem_match_list, subsystem, NULL, 1, 0) == NULL)
+                               &udev_enumerate->subsystem_match_list, subsystem, NULL, UDEV_LIST_UNIQUE) == NULL)
                return -ENOMEM;
        return 0;
 }
@@ -355,7 +355,7 @@ int udev_enumerate_add_nomatch_subsystem(struct udev_enumerate *udev_enumerate,
        if (subsystem == NULL)
                return 0;
        if (udev_list_entry_add(udev_enumerate_get_udev(udev_enumerate),
-                               &udev_enumerate->subsystem_nomatch_list, subsystem, NULL, 1, 0) == NULL)
+                               &udev_enumerate->subsystem_nomatch_list, subsystem, NULL, UDEV_LIST_UNIQUE) == NULL)
                return -ENOMEM;
        return 0;
 }
@@ -375,7 +375,7 @@ int udev_enumerate_add_match_sysattr(struct udev_enumerate *udev_enumerate, cons
        if (sysattr == NULL)
                return 0;
        if (udev_list_entry_add(udev_enumerate_get_udev(udev_enumerate),
-                          &udev_enumerate->sysattr_match_list, sysattr, value, 0, 0) == NULL)
+                               &udev_enumerate->sysattr_match_list, sysattr, value, 0) == NULL)
                return -ENOMEM;
        return 0;
 }
@@ -395,7 +395,7 @@ int udev_enumerate_add_nomatch_sysattr(struct udev_enumerate *udev_enumerate, co
        if (sysattr == NULL)
                return 0;
        if (udev_list_entry_add(udev_enumerate_get_udev(udev_enumerate),
-                          &udev_enumerate->sysattr_nomatch_list, sysattr, value, 0, 0) == NULL)
+                          &udev_enumerate->sysattr_nomatch_list, sysattr, value, 0) == NULL)
                return -ENOMEM;
        return 0;
 }
@@ -435,7 +435,7 @@ int udev_enumerate_add_match_property(struct udev_enumerate *udev_enumerate, con
        if (property == NULL)
                return 0;
        if (udev_list_entry_add(udev_enumerate_get_udev(udev_enumerate),
-                               &udev_enumerate->properties_match_list, property, value, 0, 0) == NULL)
+                               &udev_enumerate->properties_match_list, property, value, 0) == NULL)
                return -ENOMEM;
        return 0;
 }
@@ -454,7 +454,7 @@ int udev_enumerate_add_match_tag(struct udev_enumerate *udev_enumerate, const ch
        if (tag == NULL)
                return 0;
        if (udev_list_entry_add(udev_enumerate_get_udev(udev_enumerate),
-                               &udev_enumerate->tags_match_list, tag, NULL, 1, 0) == NULL)
+                               &udev_enumerate->tags_match_list, tag, NULL, UDEV_LIST_UNIQUE) == NULL)
                return -ENOMEM;
        return 0;
 }
@@ -499,7 +499,7 @@ int udev_enumerate_add_match_sysname(struct udev_enumerate *udev_enumerate, cons
        if (sysname == NULL)
                return 0;
        if (udev_list_entry_add(udev_enumerate_get_udev(udev_enumerate),
-                               &udev_enumerate->sysname_match_list, sysname, NULL, 1, 0) == NULL)
+                               &udev_enumerate->sysname_match_list, sysname, NULL, UDEV_LIST_UNIQUE) == NULL)
                return -ENOMEM;
        return 0;
 }
index b5e9645..29453ac 100644 (file)
@@ -38,10 +38,10 @@ struct udev_list_entry {
        struct udev_list_node *list;
        char *name;
        char *value;
-       unsigned int flags;
+       int num;
 };
 
-/* list head point to itself if empty */
+/* the list's head points to itself if empty */
 void udev_list_init(struct udev_list_node *list)
 {
        list->next = list;
@@ -114,12 +114,12 @@ void udev_list_entry_insert_before(struct udev_list_entry *new, struct udev_list
 
 struct udev_list_entry *udev_list_entry_add(struct udev *udev, struct udev_list_node *list,
                                            const char *name, const char *value,
-                                           int unique, int sort)
+                                           unsigned int flags)
 {
        struct udev_list_entry *entry_loop = NULL;
        struct udev_list_entry *entry_new;
 
-       if (unique)
+       if (flags & UDEV_LIST_UNIQUE) {
                udev_list_entry_foreach(entry_loop, udev_list_get_entry(list)) {
                        if (strcmp(entry_loop->name, name) == 0) {
                                dbg(udev, "'%s' is already in the list\n", name);
@@ -136,12 +136,14 @@ struct udev_list_entry *udev_list_entry_add(struct udev *udev, struct udev_list_
                                return entry_loop;
                        }
                }
+       }
 
-       if (sort)
+       if (flags & UDEV_LIST_SORT) {
                udev_list_entry_foreach(entry_loop, udev_list_get_entry(list)) {
                        if (strcmp(entry_loop->name, name) > 0)
                                break;
                }
+       }
 
        entry_new = malloc(sizeof(struct udev_list_entry));
        if (entry_new == NULL)
@@ -153,6 +155,7 @@ struct udev_list_entry *udev_list_entry_add(struct udev *udev, struct udev_list_
                free(entry_new);
                return NULL;
        }
+
        if (value != NULL) {
                entry_new->value = strdup(value);
                if (entry_new->value == NULL) {
@@ -161,10 +164,12 @@ struct udev_list_entry *udev_list_entry_add(struct udev *udev, struct udev_list_
                        return NULL;
                }
        }
+
        if (entry_loop != NULL)
                udev_list_entry_insert_before(entry_new, entry_loop);
        else
                udev_list_entry_append(entry_new, list);
+
        dbg(udev, "'%s=%s' added\n", entry_new->name, entry_new->value);
        return entry_new;
 }
@@ -258,16 +263,16 @@ const char *udev_list_entry_get_value(struct udev_list_entry *list_entry)
        return list_entry->value;
 }
 
-unsigned int udev_list_entry_get_flags(struct udev_list_entry *list_entry)
+int udev_list_entry_get_num(struct udev_list_entry *list_entry)
 {
        if (list_entry == NULL)
                return -EINVAL;
-       return list_entry->flags;
+       return list_entry->num;
 }
 
-void udev_list_entry_set_flags(struct udev_list_entry *list_entry, unsigned int flags)
+void udev_list_entry_set_num(struct udev_list_entry *list_entry, int num)
 {
        if (list_entry == NULL)
                return;
-       list_entry->flags = flags;
+       list_entry->num = num;
 }
index d890b4b..5917b9e 100644 (file)
@@ -830,7 +830,7 @@ int udev_monitor_filter_add_match_subsystem_devtype(struct udev_monitor *udev_mo
        if (subsystem == NULL)
                return -EINVAL;
        if (udev_list_entry_add(udev_monitor->udev,
-                               &udev_monitor->filter_subsystem_list, subsystem, devtype, 0, 0) == NULL)
+                               &udev_monitor->filter_subsystem_list, subsystem, devtype, 0) == NULL)
                return -ENOMEM;
        return 0;
 }
@@ -854,7 +854,7 @@ int udev_monitor_filter_add_match_tag(struct udev_monitor *udev_monitor, const c
        if (tag == NULL)
                return -EINVAL;
        if (udev_list_entry_add(udev_monitor->udev,
-                               &udev_monitor->filter_tag_list, tag, NULL, 0, 0) == NULL)
+                               &udev_monitor->filter_tag_list, tag, NULL, 0) == NULL)
                return -ENOMEM;
        return 0;
 }
index c47bbce..dbe7fd1 100644 (file)
@@ -157,6 +157,11 @@ const char *udev_ctrl_get_set_env(struct udev_ctrl_msg *ctrl_msg);
 int udev_ctrl_get_set_children_max(struct udev_ctrl_msg *ctrl_msg);
 
 /* libudev-list.c */
+enum udev_list_flags {
+       UDEV_LIST_NONE =        0,
+       UDEV_LIST_UNIQUE =      1,
+       UDEV_LIST_SORT =        1 << 1,
+};
 struct udev_list_node {
        struct udev_list_node *next, *prev;
 };
@@ -174,16 +179,15 @@ void udev_list_node_remove(struct udev_list_node *entry);
             node != list; \
             node = tmp, tmp = (tmp)->next)
 struct udev_list_entry *udev_list_entry_add(struct udev *udev, struct udev_list_node *list,
-                                                  const char *name, const char *value,
-                                                  int unique, int sort);
+                                                  const char *name, const char *value, unsigned int flags);
 void udev_list_entry_delete(struct udev_list_entry *entry);
 void udev_list_entry_remove(struct udev_list_entry *entry);
 void udev_list_entry_insert_before(struct udev_list_entry *new, struct udev_list_entry *entry);
 void udev_list_entry_append(struct udev_list_entry *new, struct udev_list_node *list);
 void udev_list_cleanup_entries(struct udev *udev, struct udev_list_node *name_list);
 struct udev_list_entry *udev_list_get_entry(struct udev_list_node *list);
-unsigned int udev_list_entry_get_flags(struct udev_list_entry *list_entry);
-void udev_list_entry_set_flags(struct udev_list_entry *list_entry, unsigned int flags);
+int udev_list_entry_get_num(struct udev_list_entry *list_entry);
+void udev_list_entry_set_num(struct udev_list_entry *list_entry, int num);
 #define udev_list_entry_foreach_safe(entry, tmp, first) \
        for (entry = first, tmp = udev_list_entry_get_next(entry); \
             entry != NULL; \
index 75c5b24..ead05c5 100644 (file)
@@ -454,7 +454,7 @@ struct udev_list_entry *udev_queue_get_queued_list_entry(struct udev_queue *udev
                        break;
 
                if (len > 0) {
-                       udev_list_entry_add(udev_queue->udev, &udev_queue->queue_list, syspath, seqnum_str, 0, 0);
+                       udev_list_entry_add(udev_queue->udev, &udev_queue->queue_list, syspath, seqnum_str, 0);
                } else {
                        udev_list_entry_foreach(list_entry, udev_list_get_entry(&udev_queue->queue_list)) {
                                if (strcmp(seqnum_str, udev_list_entry_get_value(list_entry)) == 0) {
@@ -508,7 +508,7 @@ struct udev_list_entry *udev_queue_get_failed_list_entry(struct udev_queue *udev
                util_strscpyl(filename, sizeof(filename), syspath, "/uevent", NULL);
                if (stat(filename, &statbuf) != 0)
                        continue;
-               udev_list_entry_add(udev_queue->udev, &udev_queue->failed_list, syspath, NULL, 0, 0);
+               udev_list_entry_add(udev_queue->udev, &udev_queue->failed_list, syspath, NULL, 0);
        }
        closedir(dir);
        return udev_list_get_entry(&udev_queue->failed_list);
index edc24e2..6b5c5e9 100644 (file)
@@ -458,7 +458,7 @@ struct udev_list_entry *udev_add_property(struct udev *udev, const char *key, co
                        udev_list_entry_delete(list_entry);
                return NULL;
        }
-       return udev_list_entry_add(udev, &udev->properties_list, key, value, 1, 0);
+       return udev_list_entry_add(udev, &udev->properties_list, key, value, UDEV_LIST_UNIQUE);
 }
 
 struct udev_list_entry *udev_get_properties_list_entry(struct udev *udev)
index 4af3e08..e5683cf 100644 (file)
@@ -1075,7 +1075,7 @@ int udev_event_execute_run(struct udev_event *event, const sigset_t *sigmask)
                        udev_event_apply_format(event, cmd, program, sizeof(program));
                        envp = udev_device_get_properties_envp(event->dev);
                        if (udev_event_spawn(event, program, envp, sigmask, NULL, 0) < 0) {
-                               if (udev_list_entry_get_flags(list_entry))
+                               if (udev_list_entry_get_num(list_entry))
                                        err = -1;
                        }
                }
index 5e791ff..dc7d9c3 100644 (file)
@@ -386,7 +386,7 @@ int udev_node_add(struct udev_device *dev, mode_t mode, uid_t uid, gid_t gid)
 
        /* create/update symlinks, add symlinks to name index */
        udev_list_entry_foreach(list_entry, udev_device_get_devlinks_list_entry(dev)) {
-               if (udev_list_entry_get_flags(list_entry))
+               if (udev_list_entry_get_num(list_entry))
                        /* simple unmanaged link name */
                        node_symlink(udev, udev_device_get_devnode(dev), udev_list_entry_get_name(list_entry));
                else
index 2ae30d8..892d8f2 100644 (file)
@@ -731,7 +731,7 @@ static int import_property_from_string(struct udev_device *dev, char *line)
                entry = udev_device_add_property(dev, key, val);
                /* store in db, skip private keys */
                if (key[0] != '.')
-                       udev_list_entry_set_flags(entry, 1);
+                       udev_list_entry_set_num(entry, true);
        }
        return 0;
 }
@@ -800,7 +800,7 @@ static int import_parent_into_properties(struct udev_device *dev, const char *fi
                        entry = udev_device_add_property(dev, key, val);
                        /* store in db, skip private keys */
                        if (key[0] != '.')
-                               udev_list_entry_set_flags(entry, 1);
+                               udev_list_entry_set_num(entry, true);
                }
        }
        return 0;
@@ -1750,7 +1750,7 @@ static int add_matching_files(struct udev *udev, struct udev_list_node *file_lis
                 * identical basenames from different directories overwrite each other
                 * entries are sorted after basename
                 */
-               udev_list_entry_add(udev, file_list, dent->d_name, filename, 1, 1);
+               udev_list_entry_add(udev, file_list, dent->d_name, filename, UDEV_LIST_UNIQUE|UDEV_LIST_SORT);
        }
 
        closedir(dir);
@@ -1829,13 +1829,13 @@ struct udev_rules *udev_rules_new(struct udev *udev, int resolve_names)
                filename_off = add_string(rules, filename);
                /* the offset in the rule is limited to unsigned short */
                if (filename_off < USHRT_MAX)
-                       udev_list_entry_set_flags(file_loop, filename_off);
+                       udev_list_entry_set_num(file_loop, filename_off);
        }
 
        /* parse all rules files */
        udev_list_entry_foreach(file_loop, udev_list_get_entry(&file_list)) {
                const char *filename = udev_list_entry_get_value(file_loop);
-               unsigned int filename_off = udev_list_entry_get_flags(file_loop);
+               unsigned int filename_off = udev_list_entry_get_num(file_loop);
                struct stat st;
 
                if (stat(filename, &st) != 0) {
@@ -2326,7 +2326,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event
                                        struct udev_list_entry *entry;
 
                                        entry = udev_device_add_property(event->dev, key, value);
-                                       udev_list_entry_set_flags(entry, 1);
+                                       udev_list_entry_set_num(entry, true);
                                } else {
                                        if (cur->key.op != OP_NOMATCH)
                                                goto nomatch;
@@ -2354,7 +2354,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event
                                                        if (pos[0] == '\0' || isspace(pos[0])) {
                                                                /* we import simple flags as 'FLAG=1' */
                                                                entry = udev_device_add_property(event->dev, key, "1");
-                                                               udev_list_entry_set_flags(entry, 1);
+                                                               udev_list_entry_set_num(entry, true);
                                                                imported = true;
                                                        } else if (pos[0] == '=') {
                                                                const char *value;
@@ -2365,7 +2365,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event
                                                                        pos++;
                                                                pos[0] = '\0';
                                                                entry = udev_device_add_property(event->dev, key, value);
-                                                               udev_list_entry_set_flags(entry, 1);
+                                                               udev_list_entry_set_num(entry, true);
                                                                imported = true;
                                                        }
                                                }
@@ -2510,7 +2510,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event
                                        entry = udev_device_add_property(event->dev, name, temp_value);
                                        /* store in db, skip private keys */
                                        if (name[0] != '.')
-                                               udev_list_entry_set_flags(entry, 1);
+                                               udev_list_entry_set_num(entry, true);
                                } else {
                                        udev_device_add_property(event->dev, name, NULL);
                                }
@@ -2629,9 +2629,9 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event
                                     &rules->buf[rule->rule.filename_off],
                                     rule->rule.filename_line);
                                list_entry = udev_list_entry_add(event->udev, &event->run_list,
-                                                                &rules->buf[cur->key.value_off], NULL, 1, 0);
+                                                                &rules->buf[cur->key.value_off], NULL, UDEV_LIST_UNIQUE);
                                if (cur->key.fail_on_error)
-                                       udev_list_entry_set_flags(list_entry, 1);
+                                       udev_list_entry_set_num(list_entry, true);
                                break;
                        }
                case TK_A_GOTO:
index e1bb6fe..f3a72cf 100644 (file)
@@ -122,11 +122,11 @@ int udevadm_monitor(struct udev *udev, int argc, char *argv[])
                                        devtype[0] = '\0';
                                        devtype++;
                                }
-                               udev_list_entry_add(udev, &subsystem_match_list, subsys, devtype, 0, 0);
+                               udev_list_entry_add(udev, &subsystem_match_list, subsys, devtype, 0);
                                break;
                        }
                case 't':
-                       udev_list_entry_add(udev, &tag_match_list, optarg, NULL, 0, 0);
+                       udev_list_entry_add(udev, &tag_match_list, optarg, NULL, 0);
                        break;
                case 'h':
                        printf("Usage: udevadm monitor [--property] [--kernel] [--udev] [--help]\n"