X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fdevice.c;h=aeafd5e9f377af7fcb5f440339a4917cdbfb9eaf;hb=d04247cf25057cb5b3359244cd145e4027bd8536;hp=a0349c4300470dc9cc02a7e19019488ca22b75b0;hpb=4cd1fbcc0648a289e9bf9d9047621bbdf7ec0ece;p=elogind.git diff --git a/src/device.c b/src/device.c index a0349c430..aeafd5e9f 100644 --- a/src/device.c +++ b/src/device.c @@ -244,7 +244,7 @@ static int device_process_new_device(Manager *m, struct udev_device *dev, bool u goto fail; if (wants) { - FOREACH_WORD(w, l, wants, state) { + FOREACH_WORD_QUOTED(w, l, wants, state) { 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; } - 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) @@ -270,8 +270,12 @@ static int device_process_new_device(Manager *m, struct udev_device *dev, bool u return 0; fail: + + log_warning("Failed to load device unit: %s", strerror(-r)); + if (delete && u) unit_free(u); + return r; }