X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=m4%2Fclose.m4;h=68510c5c5212ed78324f9b0406e55409fd89c86d;hb=cd56634a4a8179fd5a4419fbb3e27211b042ab1c;hp=fcc9fb1952ab50419841dbb9269b955872b5cab5;hpb=d1f20d36142dfc47393b66a1ce237c883bca0564;p=gnulib.git diff --git a/m4/close.m4 b/m4/close.m4 index fcc9fb195..68510c5c5 100644 --- a/m4/close.m4 +++ b/m4/close.m4 @@ -1,25 +1,33 @@ -# close.m4 serial 2 -dnl Copyright (C) 2008 Free Software Foundation, Inc. +# close.m4 serial 8 +dnl Copyright (C) 2008-2014 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_CLOSE], [ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_REQUIRE([gl_MSVC_INVAL]) + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + REPLACE_CLOSE=1 + fi m4_ifdef([gl_PREREQ_SYS_H_WINSOCK2], [ gl_PREREQ_SYS_H_WINSOCK2 if test $UNISTD_H_HAVE_WINSOCK2_H = 1; then - gl_REPLACE_CLOSE + dnl Even if the 'socket' module is not used here, another part of the + dnl application may use it and pass file descriptors that refer to + dnl sockets to the close() function. So enable the support for sockets. + REPLACE_CLOSE=1 + fi + ]) + dnl Replace close() for supporting the gnulib-defined fchdir() function, + dnl to keep fchdir's bookkeeping up-to-date. + m4_ifdef([gl_FUNC_FCHDIR], [ + if test $REPLACE_CLOSE = 0; then + gl_TEST_FCHDIR + if test $HAVE_FCHDIR = 0; then + REPLACE_CLOSE=1 + fi fi ]) -]) - -AC_DEFUN([gl_REPLACE_CLOSE], -[ - AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) - if test $REPLACE_CLOSE != 1; then - AC_LIBOBJ([close]) - fi - REPLACE_CLOSE=1 - gl_REPLACE_FCLOSE ])