summaryrefslogtreecommitdiff
path: root/lib/read.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2021-01-20 21:52:54 +0100
committerAndy Wingo <wingo@pobox.com>2021-01-20 23:03:56 +0100
commita91b95cca2d397c84f8b9bbd602d40209a7092ce (patch)
tree2c286a291f5a2b812d6e216be10936f2709d59cf /lib/read.c
parent758b31994cff582c7e8785b4cc2240dbf3573837 (diff)
downloadguile-a91b95cca2d397c84f8b9bbd602d40209a7092ce.tar.gz
Update Gnulib to v0.1-4379-g2ef5a9b4b
Also bump required autoconf version to 2.64, as required by Gnulib.
Diffstat (limited to 'lib/read.c')
-rw-r--r--lib/read.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/lib/read.c b/lib/read.c
index 5385cfd5a..125e73874 100644
--- a/lib/read.c
+++ b/lib/read.c
@@ -1,5 +1,5 @@
/* POSIX compatible read() function.
- Copyright (C) 2008-2017 Free Software Foundation, Inc.
+ Copyright (C) 2008-2021 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2011.
This program is free software: you can redistribute it and/or modify
@@ -13,14 +13,14 @@
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
#include <config.h>
/* Specification. */
#include <unistd.h>
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
# include <errno.h>
# include <io.h>
@@ -28,8 +28,18 @@
# define WIN32_LEAN_AND_MEAN /* avoid including junk */
# include <windows.h>
-# include "msvc-inval.h"
-# include "msvc-nothrow.h"
+# if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+# include "msvc-inval.h"
+# endif
+# if GNULIB_MSVC_NOTHROW
+# include "msvc-nothrow.h"
+# else
+# include <io.h>
+# endif
+
+/* Don't assume that UNICODE is not defined. */
+# undef GetNamedPipeHandleState
+# define GetNamedPipeHandleState GetNamedPipeHandleStateA
# undef read
@@ -41,7 +51,7 @@ read_nothrow (int fd, void *buf, size_t count)
TRY_MSVC_INVAL
{
- result = read (fd, buf, count);
+ result = _read (fd, buf, count);
}
CATCH_MSVC_INVAL
{
@@ -53,7 +63,7 @@ read_nothrow (int fd, void *buf, size_t count)
return result;
}
# else
-# define read_nothrow read
+# define read_nothrow _read
# endif
ssize_t