Blame m4/open-cloexec.m4

Packit 8f70b4
# Test whether O_CLOEXEC is defined.
Packit 8f70b4
Packit 8f70b4
dnl Copyright 2017-2018 Free Software Foundation, Inc.
Packit 8f70b4
dnl This file is free software; the Free Software Foundation
Packit 8f70b4
dnl gives unlimited permission to copy and/or distribute it,
Packit 8f70b4
dnl with or without modifications, as long as this notice is preserved.
Packit 8f70b4
Packit 8f70b4
AC_DEFUN([gl_PREPROC_O_CLOEXEC],
Packit 8f70b4
[
Packit 8f70b4
  AC_CACHE_CHECK([for O_CLOEXEC],
Packit 8f70b4
    [gl_cv_macro_O_CLOEXEC],
Packit 8f70b4
    [AC_COMPILE_IFELSE(
Packit 8f70b4
       [AC_LANG_PROGRAM([[#include <fcntl.h>
Packit 8f70b4
                          #ifndef O_CLOEXEC
Packit 8f70b4
                            choke me;
Packit 8f70b4
                          #endif
Packit 8f70b4
                        ]],
Packit 8f70b4
                        [[return O_CLOEXEC;]])],
Packit 8f70b4
       [gl_cv_macro_O_CLOEXEC=yes],
Packit 8f70b4
       [gl_cv_macro_O_CLOEXEC=no])])
Packit 8f70b4
])