summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <philip@tecnocode.co.uk>2018-09-29 09:18:15 +0000
committerPhilip Withnall <philip@tecnocode.co.uk>2018-09-29 09:18:15 +0000
commite1f4ff6c252f81178fffb7155ce3537186eb8498 (patch)
tree374bd93dfbcffaeb2278534c917c3a70334c45cf
parent4c05f339a96f5e6b6eab9f5420e0c5f70e6a2be9 (diff)
parenta187c8900291c4266471da17f2073d81c663b832 (diff)
downloadglib-e1f4ff6c252f81178fffb7155ce3537186eb8498.tar.gz
Merge branch 'non-POSIX-spawn' into 'master'
Fix build failure on systems without POSIX spawn See merge request GNOME/glib!345
-rw-r--r--configure.ac1
-rw-r--r--glib/gspawn.c3
-rw-r--r--meson.build1
3 files changed, 5 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 386efcf63..b69b27ca5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -639,6 +639,7 @@ AC_CHECK_HEADERS([mntent.h sys/mnttab.h sys/vfstab.h sys/mntctl.h fstab.h])
AC_CHECK_HEADERS([linux/magic.h])
AC_CHECK_HEADERS([termios.h])
AC_CHECK_HEADERS([alloca.h])
+AC_CHECK_HEADERS([spawn.h])
# Some versions of MSC lack these
AC_CHECK_HEADERS([dirent.h sys/time.h])
diff --git a/glib/gspawn.c b/glib/gspawn.c
index 5d0c29d70..23ade06ae 100644
--- a/glib/gspawn.c
+++ b/glib/gspawn.c
@@ -30,7 +30,10 @@
#include <string.h>
#include <stdlib.h> /* for fdwalk */
#include <dirent.h>
+
+#ifdef HAVE_SPAWN_H
#include <spawn.h>
+#endif /* HAVE_SPAWN_H */
#ifdef HAVE_CRT_EXTERNS_H
#include <crt_externs.h> /* for _NSGetEnviron */
diff --git a/meson.build b/meson.build
index adb07638e..dd5bd8f3f 100644
--- a/meson.build
+++ b/meson.build
@@ -227,6 +227,7 @@ headers = [
'poll.h',
'pwd.h',
'sched.h',
+ 'spawn.h',
'stdint.h',
'stdlib.h',
'string.h',