summaryrefslogtreecommitdiff
path: root/udev
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2011-04-24 00:22:23 +0200
committerKay Sievers <kay.sievers@vrfy.org>2011-04-24 00:22:23 +0200
commit8958da13c72024c4eaa2996b86fce2959e452db4 (patch)
tree4edf78daf3d43092edf7e91ff5e9943ccd6aa3b6 /udev
parentc7c32e9c9835a0bdaee931f33ac0fc86a1e4c415 (diff)
libudev: list - use bit flags for 'sort' and 'unique'
Diffstat (limited to 'udev')
-rw-r--r--udev/udev-event.c2
-rw-r--r--udev/udev-node.c2
-rw-r--r--udev/udev-rules.c22
-rw-r--r--udev/udevadm-monitor.c4
4 files changed, 15 insertions, 15 deletions
diff --git a/udev/udev-event.c b/udev/udev-event.c
index 4af3e08f60..e5683cfc2a 100644
--- a/udev/udev-event.c
+++ b/udev/udev-event.c
@@ -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;
}
}
diff --git a/udev/udev-node.c b/udev/udev-node.c
index 5e791ffb6c..dc7d9c365a 100644
--- a/udev/udev-node.c
+++ b/udev/udev-node.c
@@ -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
diff --git a/udev/udev-rules.c b/udev/udev-rules.c
index 2ae30d81f6..892d8f27a7 100644
--- a/udev/udev-rules.c
+++ b/udev/udev-rules.c
@@ -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:
diff --git a/udev/udevadm-monitor.c b/udev/udevadm-monitor.c
index e1bb6fe18e..f3a72cf17e 100644
--- a/udev/udevadm-monitor.c
+++ b/udev/udevadm-monitor.c
@@ -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"