chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
device: properly create dependencies
[elogind.git]
/
src
/
device.c
diff --git
a/src/device.c
b/src/device.c
index adc6cc1e275cf1d7a78392c03855f0174b63d153..aeafd5e9f377af7fcb5f440339a4917cdbfb9eaf 100644
(file)
--- a/
src/device.c
+++ b/
src/device.c
@@
-53,7
+53,7
@@
static void device_set_state(Device *d, DeviceState state) {
if (state != old_state)
log_debug("%s changed %s -> %s",
if (state != old_state)
log_debug("%s changed %s -> %s",
-
UNIT(d)
->meta.id,
+
d
->meta.id,
device_state_to_string(old_state),
device_state_to_string(state));
device_state_to_string(old_state),
device_state_to_string(state));
@@
-244,7
+244,7
@@
static int device_process_new_device(Manager *m, struct udev_device *dev, bool u
goto fail;
if (wants) {
goto fail;
if (wants) {
- FOREACH_WORD(w, l, wants, state) {
+ FOREACH_WORD
_QUOTED
(w, l, wants, state) {
char *e;
if (!(e = strndup(w, l))) {
char *e;
if (!(e = strndup(w, l))) {
@@
-252,7
+252,7
@@
static int device_process_new_device(Manager *m, struct udev_device *dev, bool u
goto fail;
}
goto fail;
}
- r = unit_add_dependency_by_name(u, UNIT_WANTS,
NULL, e
, true);
+ r = unit_add_dependency_by_name(u, UNIT_WANTS,
e, NULL
, true);
free(e);
if (r < 0)
free(e);
if (r < 0)
@@
-270,8
+270,12
@@
static int device_process_new_device(Manager *m, struct udev_device *dev, bool u
return 0;
fail:
return 0;
fail:
+
+ log_warning("Failed to load device unit: %s", strerror(-r));
+
if (delete && u)
unit_free(u);
if (delete && u)
unit_free(u);
+
return r;
}
return r;
}