summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-04-08 21:09:06 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-04-08 21:09:06 -0400
commitd929b0f98bf2c3b1698f760799a1999b878724f6 (patch)
tree630f6e782ad7188ce2af8ebc99238ac37fc01ea9 /src
parentddea446252fad05bc28ede2ee2043f8d96addd65 (diff)
nspawn: ignore failure to chdir
CID #1322380.
Diffstat (limited to 'src')
-rw-r--r--src/nspawn/nspawn.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index eb89916b7e..c96a04cd5e 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -2648,7 +2648,8 @@ static int inner_child(
execvpe(arg_parameters[0], arg_parameters, env_use);
else {
if (!arg_chdir)
- chdir(home ?: "/root");
+ /* If we cannot change the directory, we'll end up in /, that is expected. */
+ (void) chdir(home ?: "/root");
execle("/bin/bash", "-bash", NULL, env_use);
execle("/bin/sh", "-sh", NULL, env_use);