]> err.no Git - systemd/commitdiff
load-fragment: fix parsing of Socket= setting
authorLennart Poettering <lennart@poettering.net>
Sat, 7 Jan 2012 00:21:40 +0000 (01:21 +0100)
committerLennart Poettering <lennart@poettering.net>
Sat, 7 Jan 2012 00:26:08 +0000 (01:26 +0100)
src/load-fragment.c

index 19031904f1c9bf4a3749a82b79313a913d958f94..ef5d192f2a0fecbbdd7310a8bdacc5456689b7f9 100644 (file)
@@ -1386,6 +1386,7 @@ int config_parse_socket_service(
         Socket *s = data;
         int r;
         DBusError error;
+        Unit *x;
 
         assert(filename);
         assert(lvalue);
@@ -1399,12 +1400,15 @@ int config_parse_socket_service(
                 return 0;
         }
 
-        if ((r = manager_load_unit(s->meta.manager, rvalue, NULL, &error, (Unit**) &s->service)) < 0) {
+        r = manager_load_unit(s->meta.manager, rvalue, NULL, &error, &x);
+        if (r < 0) {
                 log_error("[%s:%u] Failed to load unit %s, ignoring: %s", filename, line, rvalue, bus_error(&error, r));
                 dbus_error_free(&error);
                 return 0;
         }
 
+        unit_ref_set(&s->service, x);
+
         return 0;
 }