aboutsummaryrefslogtreecommitdiff
path: root/slave.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-11-01 20:01:15 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-11-01 20:01:15 +0000
commit69d62d3cd2918bee089fc879e381820349497483 (patch)
tree44a9c5129aaf60452a6c1880a42d3b3389aff465 /slave.c
parentPKGBUILD: need to execute footclient, to generate profiling data (diff)
slave: set TERM environment variable in slave process
Diffstat (limited to 'slave.c')
-rw-r--r--slave.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/slave.c b/slave.c
index 0e762bf0..1f70a0d8 100644
--- a/slave.c
+++ b/slave.c
@@ -1,5 +1,6 @@
#define _XOPEN_SOURCE 500
#include "slave.h"
+
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
@@ -68,7 +69,7 @@ err:
pid_t
slave_spawn(int ptmx, int argc, char *const *argv,
- const char *conf_shell)
+ const char *term_env, const char *conf_shell)
{
int fork_pipe[2];
if (pipe2(fork_pipe, O_CLOEXEC) < 0) {
@@ -88,6 +89,8 @@ slave_spawn(int ptmx, int argc, char *const *argv,
/* Child */
close(fork_pipe[0]); /* Close read end */
+ setenv("TERM", term_env, 1);
+
char **_shell_argv = NULL;
char *const *shell_argv = argv;