chiark / gitweb /
nspawn: mount a clean instance of sysfs
[elogind.git] / src / core / load-fragment.c
index bbd82b9d2472d4cda178d530fbb49506da80cad4..c6422619f5d008db5dcd104c1347a88340d635f1 100644 (file)
@@ -1376,10 +1376,16 @@ int config_parse_service_timeout(
 
         r = config_parse_usec(filename, line, section, lvalue, ltype, rvalue, data, userdata);
 
-        if (!r)
-                s->timeout_defined = true;
+        if (r)
+                return r;
 
-        return r;
+        if (streq(lvalue, "TimeoutSec")) {
+                s->start_timeout_defined = true;
+                s->timeout_stop_usec = s->timeout_start_usec;
+        } else if (streq(lvalue, "TimeoutStartSec"))
+                s->start_timeout_defined = true;
+
+        return 0;
 }
 
 int config_parse_unit_env_file(
@@ -1510,14 +1516,17 @@ int config_parse_unit_condition_string(
         assert(rvalue);
         assert(data);
 
-        if ((trigger = rvalue[0] == '|'))
+        trigger = rvalue[0] == '|';
+        if (trigger)
                 rvalue++;
 
-        if ((negate = rvalue[0] == '!'))
+        negate = rvalue[0] == '!';
+        if (negate)
                 rvalue++;
 
-        if (!(c = condition_new(cond, rvalue, trigger, negate)))
-                return -ENOMEM;
+        c = condition_new(cond, rvalue, trigger, negate);
+        if (!c)
+                return log_oom();
 
         LIST_PREPEND(Condition, conditions, u->conditions, c);
         return 0;
@@ -2022,7 +2031,7 @@ int config_parse_syscall_filter(
 
         ExecContext *c = data;
         Unit *u = userdata;
-        bool invert;
+        bool invert = false;
         char *w;
         size_t l;
         char *state;