nspawn: add proper error message if setns() on network namespace fd fails
authorLennart Poettering <lennart@poettering.net>
Wed, 31 Oct 2018 15:17:22 +0000 (16:17 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 31 Oct 2018 17:07:30 +0000 (18:07 +0100)
Addresses: https://github.com/systemd/systemd/pull/10589#issuecomment-434670595

src/nspawn/nspawn.c

index fb6b603..ee78b4f 100644 (file)
@@ -3148,7 +3148,7 @@ static int outer_child(
                 if (arg_network_namespace_path) {
                         r = namespace_enter(-1, -1, netns_fd, -1, -1);
                         if (r < 0)
-                                return r;
+                                return log_error_errno(r, "Failed to join network namespace: %m");
                 }
 
                 r = inner_child(barrier, directory, secondary, kmsg_socket, rtnl_socket, fds);