Skip to content

Commit

Permalink
On systems without clearenv() the environ variable must be imported a…
Browse files Browse the repository at this point in the history
…s 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.
  • Loading branch information
madpilot78 authored and robert-ancell committed Jun 9, 2019
1 parent 170df31 commit 1b99bc2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 1b99bc2

Please sign in to comment.