summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Falsi <mad@madpilot.net>2019-06-07 09:35:38 +0200
committerRobert Ancell <robert.ancell@gmail.com>2019-06-10 10:51:11 +1200
commit1b99bc2ed9ad5093ab8b4c7b8ed46b3a04bfcc65 (patch)
treee6638c1cf531c601e9fb96d8136299dd211952ca
parent170df31f7d9c00b049bdd158682472df915adeae (diff)
downloadlightdm-git-1b99bc2ed9ad5093ab8b4c7b8ed46b3a04bfcc65.tar.gz
On systems without clearenv() the environ variable must be imported as external before it can be manipulated to reset the environment.
This is, for example, necessary on FreeBSD, otherwise the effect of "environ = NULL" is a compiler error or in some cases to create a new local variable.
-rw-r--r--src/process.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/process.c b/src/process.c
index fc1652f1..d25c909b 100644
--- a/src/process.c
+++ b/src/process.c
@@ -73,6 +73,10 @@ static GHashTable *processes = NULL;
static pid_t signal_pid;
static int signal_pipe[2];
+#ifndef HAVE_CLEARENV
+extern char **environ;
+#endif
+
Process *
process_get_current (void)
{