chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
hwdb: add --lookup-prefix= option
[elogind.git]
/
src
/
udev
/
udev-event.c
diff --git
a/src/udev/udev-event.c
b/src/udev/udev-event.c
index 8c8b058df78954fb19b47d0633578f16179474dc..3db2cb7165a512d7de30cbafad7829e91b22d384 100644
(file)
--- a/
src/udev/udev-event.c
+++ b/
src/udev/udev-event.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (C) 2003-201
0
Kay Sievers <kay@vrfy.org>
+ * Copyright (C) 2003-201
3
Kay Sievers <kay@vrfy.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@
-784,7
+784,7
@@
int udev_event_execute_rules(struct udev_event *event, struct udev_rules *rules,
if (udev_device_get_subsystem(dev) == NULL)
return -1;
if (udev_device_get_subsystem(dev) == NULL)
return -1;
- if (str
cmp(udev_device_get_action(dev), "remove") == 0
) {
+ if (str
eq(udev_device_get_action(dev), "remove")
) {
udev_device_read_db(dev, NULL);
udev_device_delete_db(dev);
udev_device_tag_index(dev, NULL, false);
udev_device_read_db(dev, NULL);
udev_device_delete_db(dev);
udev_device_tag_index(dev, NULL, false);
@@
-812,8
+812,8
@@
int udev_event_execute_rules(struct udev_event *event, struct udev_rules *rules,
udev_rules_apply_to_event(rules, event, sigmask);
/* rename a new network interface, if needed */
udev_rules_apply_to_event(rules, event, sigmask);
/* rename a new network interface, if needed */
- if (udev_device_get_ifindex(dev) > 0 && str
cmp(udev_device_get_action(dev), "add") == 0
&&
- event->name != NULL &&
strcmp(event->name, udev_device_get_sysname(dev)) != 0
) {
+ if (udev_device_get_ifindex(dev) > 0 && str
eq(udev_device_get_action(dev), "add")
&&
+ event->name != NULL &&
!streq(event->name, udev_device_get_sysname(dev))
) {
char syspath[UTIL_PATH_SIZE];
char *pos;
char syspath[UTIL_PATH_SIZE];
char *pos;
@@
-838,6
+838,8
@@
int udev_event_execute_rules(struct udev_event *event, struct udev_rules *rules,
}
if (major(udev_device_get_devnum(dev)) > 0) {
}
if (major(udev_device_get_devnum(dev)) > 0) {
+ bool apply;
+
/* remove/update possible left-over symlinks from old database entry */
if (event->dev_db != NULL)
udev_node_update_old_links(dev, event->dev_db);
/* remove/update possible left-over symlinks from old database entry */
if (event->dev_db != NULL)
udev_node_update_old_links(dev, event->dev_db);
@@
-861,7
+863,8
@@
int udev_event_execute_rules(struct udev_event *event, struct udev_rules *rules,
}
}
}
}
- udev_node_add(dev, event->mode, event->uid, event->gid);
+ apply = streq(udev_device_get_action(dev), "add") || event->owner_set || event->group_set || event->mode_set;
+ udev_node_add(dev, apply, event->mode, event->uid, event->gid);
}
/* preserve old, or get new initialization timestamp */
}
/* preserve old, or get new initialization timestamp */