mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 02:33:24 -03:00
init: only use pipe2 if availabile, check in configure
This commit is contained in:
parent
828bb776d2
commit
584fd91d2d
2 changed files with 3 additions and 1 deletions
|
@ -925,6 +925,8 @@ AC_CHECK_DECLS([strnlen])
|
|||
dnl Check for daemon(3), unrelated to --with-daemon (although used by it)
|
||||
AC_CHECK_DECLS([daemon])
|
||||
|
||||
AC_CHECK_DECLS([pipe2])
|
||||
|
||||
AC_CHECK_DECLS([le16toh, le32toh, le64toh, htole16, htole32, htole64, be16toh, be32toh, be64toh, htobe16, htobe32, htobe64],,,
|
||||
[#if HAVE_ENDIAN_H
|
||||
#include <endian.h>
|
||||
|
|
|
@ -32,7 +32,7 @@ static int g_shutdown_pipe[2] = {-1, -1};
|
|||
bool InitShutdownState()
|
||||
{
|
||||
#ifndef WIN32
|
||||
#if HAVE_O_CLOEXEC
|
||||
#if HAVE_O_CLOEXEC && HAVE_DECL_PIPE2
|
||||
// If we can, make sure that the file descriptors are closed on exec()
|
||||
// to prevent interference.
|
||||
if (pipe2(g_shutdown_pipe, O_CLOEXEC) != 0) {
|
||||
|
|
Loading…
Add table
Reference in a new issue