blob: 6e6f199ef17ec009ad2b7b3a1a7f278066fde34c [file] [log] [blame]
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05001From ae999ff50efb9cc82537adef7696c6f732afcfc8 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 20 Feb 2015 05:10:37 +0000
4Subject: [PATCH 08/36] nspawn: Use execvpe only when libc supports it
5
6Upstream-Status: Denied [no desire for uclibc support]
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9---
10 src/nspawn/nspawn.c | 7 +++++++
11 1 file changed, 7 insertions(+)
12
13diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
14index 5a68fec..65e65ec 100644
15--- a/src/nspawn/nspawn.c
16+++ b/src/nspawn/nspawn.c
17@@ -111,6 +111,8 @@ typedef enum LinkJournal {
18 LINK_GUEST
19 } LinkJournal;
20
21+#include "config.h"
22+
23 static char *arg_directory = NULL;
24 static char *arg_template = NULL;
25 static char *arg_chdir = NULL;
26@@ -2637,7 +2639,12 @@ static int inner_child(
27 a[0] = (char*) "/sbin/init";
28 execve(a[0], a, env_use);
29 } else if (!strv_isempty(arg_parameters))
30+#ifdef HAVE_EXECVPE
31 execvpe(arg_parameters[0], arg_parameters, env_use);
32+#else
33+ environ = env_use;
34+ execvp(arg_parameters[0], arg_parameters);
35+#endif /* HAVE_EXECVPE */
36 else {
37 if (!arg_chdir)
38 chdir(home ?: "/root");
39--
401.8.3.1
41