summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaweł Szewczyk <p.szewczyk@samsung.com>2019-07-26 10:48:24 +0200
committerPaweł Szewczyk <p.szewczyk@samsung.com>2019-07-26 10:48:24 +0200
commit29816a7d88d6f1c9db9a5015529d7a93d50c03c1 (patch)
tree129220f6a9a4c596df7279a3162c776dc61426e6 /src
parent416c4052098181237544093bab2a20002cbd4601 (diff)
downloadsystemd-29816a7d88d6f1c9db9a5015529d7a93d50c03c1.tar.gz
systemd-29816a7d88d6f1c9db9a5015529d7a93d50c03c1.tar.bz2
systemd-29816a7d88d6f1c9db9a5015529d7a93d50c03c1.zip
Use separate udev tag for devices in user sessionsubmit/tizen/20190819.093056accepted/tizen/unified/20190820.115107
The system-user tag can be used to mark devices that will be enumerated by systemd in 'systemd --user' instance. Change-Id: I5889f50df6c329de36c2544ee5cf1ba1c52ad433 Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
Diffstat (limited to 'src')
-rw-r--r--src/core/device.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/core/device.c b/src/core/device.c
index 16e56efcc3..592ec473fe 100644
--- a/src/core/device.c
+++ b/src/core/device.c
@@ -610,6 +610,12 @@ static void device_enumerate(Manager *m) {
_cleanup_udev_enumerate_unref_ struct udev_enumerate *e = NULL;
struct udev_list_entry *item = NULL, *first = NULL;
int r;
+ const char *udev_tag;
+
+ if (MANAGER_IS_USER(m))
+ udev_tag = "systemd-user";
+ else
+ udev_tag = "systemd";
assert(m);
@@ -625,7 +631,7 @@ static void device_enumerate(Manager *m) {
* during boot. */
(void) udev_monitor_set_receive_buffer_size(m->udev_monitor, 128*1024*1024);
- r = udev_monitor_filter_add_match_tag(m->udev_monitor, "systemd");
+ r = udev_monitor_filter_add_match_tag(m->udev_monitor, udev_tag);
if (r < 0) {
log_error_errno(r, "Failed to add udev tag match: %m");
goto fail;
@@ -652,7 +658,7 @@ static void device_enumerate(Manager *m) {
goto fail;
}
- r = udev_enumerate_add_match_tag(e, "systemd");
+ r = udev_enumerate_add_match_tag(e, udev_tag);
if (r < 0) {
log_error_errno(r, "Failed to create udev tag enumeration: %m");
goto fail;