]> err.no Git - systemd/commitdiff
unit: fix assert when trying to load unit instances for uninstanciable types
authorLennart Poettering <lennart@poettering.net>
Wed, 27 Apr 2011 23:26:39 +0000 (01:26 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 27 Apr 2011 23:26:42 +0000 (01:26 +0200)
http://lists.freedesktop.org/archives/systemd-devel/2011-April/001910.html

TODO
src/unit.c

diff --git a/TODO b/TODO
index a7a4fc065b7e95ffcdc3a1661b4244062662f3cc..106ee974d3f8df45b9a5bbfc74dd27162d7189df 100644 (file)
--- a/TODO
+++ b/TODO
@@ -2,8 +2,6 @@ F15:
 
 * swap units that are activated by one name but shown in the kernel under another are semi-broken
 
-* Fix assert http://lists.freedesktop.org/archives/systemd-devel/2011-April/001910.html
-
 * 0595f9a1c182a84581749823ef47c5f292e545f9 is borked, freezes shutdown
     (path: after installing inotify watches, recheck file again to fix race)
 
@@ -38,8 +36,6 @@ Features:
 
 * ensure we strip empty directories from search path
 
-* maybe lower default timeout to 2min?
-
 * GC unreferenced jobs (such as .device jobs)
 
 * support wildcard expansion in ListenStream= and friends
index aed25e4f215e34f437a8cf55db4b9270fc9e28a4..b7ff0c51fe9f40b4914da36d8513232ce40e9500 100644 (file)
@@ -118,8 +118,10 @@ int unit_add_name(Unit *u, const char *text) {
         if ((r = unit_name_to_instance(s, &i)) < 0)
                 goto fail;
 
-        if (i && unit_vtable[t]->no_instances)
+        if (i && unit_vtable[t]->no_instances) {
+                r = -EINVAL;
                 goto fail;
+        }
 
         /* Ensure that this unit is either instanced or not instanced,
          * but not both. */