X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Fexecute.c;h=1f6072c6aba368f886ec24b604e90c5f3de6e4d5;hb=4c08c8242a687e00b289e948ccd07b96f0bc4866;hp=874cdc7efee2730e12c09063920cc54b10c3ec3c;hpb=63c372cb9df3bee01e3bf8cd7f96f336bddda846;p=elogind.git diff --git a/src/core/execute.c b/src/core/execute.c index 874cdc7ef..1f6072c6a 100644 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -40,8 +40,6 @@ #include #include #include -#include -#undef basename #ifdef HAVE_PAM #include @@ -1619,7 +1617,8 @@ static int exec_child( return -errno; } - if (chdir(context->working_directory ? context->working_directory : "/") < 0) { + if (chdir(context->working_directory ?: "/") < 0 && + !context->working_directory_missing_ok) { *exit_status = EXIT_CHDIR; return -errno; }