NetBSD/OpenBSD: Compile fix and proper detection of pipe2

Add the necessary defines for HAVE_PIPE2 for NetBSD and OpenBSD depending
on OS version when pipe2(2) was added. This also fixes the compile error
on NetBSD if -Werror=unused-function for ignore_sigpipe() as the
HAVE_PIPE2 tree is prior to O_NOSIGPIPE in create_pipe().

Change-Id: Ic8f875e34ef826a7bf046c77588afecaa097deca
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Ralf Nolden 2016-06-02 13:46:52 +02:00
parent 9c01fdb2ba
commit 4fc7971478

View File

@ -30,6 +30,9 @@
#include "forkfd.h"
#include <sys/types.h>
#if defined(__OpenBSD__) || defined(__NetBSD__)
# include <sys/param.h>
#endif
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/wait.h>
@ -65,7 +68,9 @@
# undef HAVE_WAITID
#endif
#if defined(__FreeBSD__) && defined(__FreeBSD_version) && __FreeBSD_version >= 1000032
#if (defined(__FreeBSD__) && defined(__FreeBSD_version) && __FreeBSD_version >= 1000032) || \
(defined(__OpenBSD__) && OpenBSD >= 201505) || \
(defined(__NetBSD__) && __NetBSD_Version__ >= 600000000)
# define HAVE_PIPE2 1
#endif
#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__) || \