if (names) {
FOREACH_WORD(w, l, names, state) {
- if (!(e = strndup(w, l)))
+ if (!(e = strndup(w, l))) {
+ r = -ENOMEM;
goto fail;
+ }
r = unit_add_name(u, e);
free(e);
if (wants) {
FOREACH_WORD(w, l, wants, state) {
- if (!(e = strndup(w, l)))
+ if (!(e = strndup(w, l))) {
+ r = -ENOMEM;
goto fail;
+ }
r = unit_add_dependency_by_name(u, UNIT_WANTS, e);
free(e);
assert(m);
assert(events == EPOLLIN);
- log_debug("got udev event");
-
if (!(dev = udev_monitor_receive_device(m->udev_monitor))) {
log_error("Failed to receive device.");
return;
const UnitVTable device_vtable = {
.suffix = ".device",
- .init = unit_load_fragment_and_dropin,
+ .init = unit_load_fragment_and_dropin_optional,
.done = device_done,
.coldplug = device_coldplug,