chiark / gitweb /
util: add timeout to generator execution
[elogind.git] / src / core / unit.c
index 1c0b0c72ace24ccaa506f2e81a6a6a1f1a660f17..2437ee3f66afd113763db4eab10167a8cf578d8f 100644 (file)
@@ -2803,7 +2803,7 @@ int unit_exec_context_patch_defaults(Unit *u, ExecContext *c) {
          * _after_ the rest of the settings have been initialized */
 
         /* This only copies in the ones that need memory */
-        for (i = 0; i < RLIMIT_NLIMITS; i++)
+        for (i = 0; i < _RLIMIT_MAX; i++)
                 if (u->manager->rlimit[i] && !c->rlimit[i]) {
                         c->rlimit[i] = newdup(struct rlimit, u->manager->rlimit[i], 1);
                         if (!c->rlimit[i])
@@ -3181,11 +3181,9 @@ int unit_require_mounts_for(Unit *u, const char *path) {
                 return 0;
         }
 
-        r = strv_push(&u->requires_mounts_for, p);
-        if (r < 0) {
-                free(p);
+        r = strv_consume(&u->requires_mounts_for, p);
+        if (r < 0)
                 return r;
-        }
 
         PATH_FOREACH_PREFIX_MORE(prefix, p) {
                 Set *x;