chiark / gitweb /
unit: set default working directory to the user's home directory when running in...
[elogind.git] / src / core / swap.c
index e7ed1b88d728c710a813c87aeef5103d80e4e20c..ed61ba3c816493e466fca490966a38d4f5f3eaf7 100644 (file)
@@ -294,6 +294,10 @@ static int swap_load(Unit *u) {
                 if (UNIT(s)->default_dependencies)
                         if ((r = swap_add_default_dependencies(s)) < 0)
                                 return r;
+
+                r = unit_patch_working_directory(UNIT(s), &s->exec_context);
+                if (r < 0)
+                        return r;
         }
 
         return swap_verify(s);
@@ -590,6 +594,7 @@ static int swap_spawn(Swap *s, ExecCommand *c, pid_t *_pid) {
                             UNIT(s)->cgroup_bondings,
                             UNIT(s)->cgroup_attributes,
                             NULL,
+                            UNIT(s)->id,
                             NULL,
                             &pid)) < 0)
                 goto fail;
@@ -1334,7 +1339,6 @@ static const char* const swap_result_table[_SWAP_RESULT_MAX] = {
 DEFINE_STRING_TABLE_LOOKUP(swap_result, SwapResult);
 
 const UnitVTable swap_vtable = {
-        .suffix = ".swap",
         .object_size = sizeof(Swap),
         .sections =
                 "Unit\0"