mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 23:16:14 +01:00
gspawn: Declare environ
Function do_posix_spawn uses environ, but gspawn.c doesn't declare it. Since there is no system header declaring this global variable, this causes compilation error on FreeBSD. Code added in this commit is copied from genviron.c.
This commit is contained in:
parent
0f77dc847b
commit
e14c853d9a
@ -32,6 +32,10 @@
|
||||
#include <dirent.h>
|
||||
#include <spawn.h>
|
||||
|
||||
#ifdef HAVE_CRT_EXTERNS_H
|
||||
#include <crt_externs.h> /* for _NSGetEnviron */
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_SELECT_H
|
||||
#include <sys/select.h>
|
||||
#endif /* HAVE_SYS_SELECT_H */
|
||||
@ -71,6 +75,12 @@
|
||||
#endif /* __GLIBC__ */
|
||||
#endif /* HAVE_POSIX_SPAWN */
|
||||
|
||||
#ifdef HAVE__NSGETENVIRON
|
||||
#define environ (*_NSGetEnviron())
|
||||
#else
|
||||
extern char **environ;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* SECTION:spawn
|
||||
* @Short_description: process launching
|
||||
|
Loading…
Reference in New Issue
Block a user