summaryrefslogtreecommitdiff
path: root/gnulib/import/close.c
diff options
context:
space:
mode:
Diffstat (limited to 'gnulib/import/close.c')
-rw-r--r--gnulib/import/close.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gnulib/import/close.c b/gnulib/import/close.c
index 0c8780dc24a..e1264d52342 100644
--- a/gnulib/import/close.c
+++ b/gnulib/import/close.c
@@ -1,5 +1,5 @@
/* close replacement.
- Copyright (C) 2008-2020 Free Software Foundation, Inc.
+ Copyright (C) 2008-2021 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -28,7 +28,8 @@
#undef close
-#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+#if defined _WIN32 && !defined __CYGWIN__
+# if HAVE_MSVC_INVALID_PARAMETER_HANDLER
static int
close_nothrow (int fd)
{
@@ -36,7 +37,7 @@ close_nothrow (int fd)
TRY_MSVC_INVAL
{
- result = close (fd);
+ result = _close (fd);
}
CATCH_MSVC_INVAL
{
@@ -47,6 +48,9 @@ close_nothrow (int fd)
return result;
}
+# else
+# define close_nothrow _close
+# endif
#else
# define close_nothrow close
#endif