summaryrefslogtreecommitdiff
path: root/lib/fpending.c
diff options
context:
space:
mode:
authorClint Adams <clint@debian.org>2018-07-04 13:05:31 -0400
committerClint Adams <clint@debian.org>2018-07-04 13:05:31 -0400
commit117dcd10d7e04d0dda7668518b8d085027f4d705 (patch)
treef9612d6268ab16555fb21be04bc7594f9eb6ce4f /lib/fpending.c
parent1c0d840cad3dc7c951a86c9c128a721e9ebcd2cf (diff)
New upstream version 4.5
Diffstat (limited to 'lib/fpending.c')
-rw-r--r--lib/fpending.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/fpending.c b/lib/fpending.c
index c9b7786..7bc235d 100644
--- a/lib/fpending.c
+++ b/lib/fpending.c
@@ -1,5 +1,5 @@
/* fpending.c -- return the number of pending output bytes on a stream
- Copyright (C) 2000, 2004, 2006-2007, 2009-2017 Free Software Foundation,
+ Copyright (C) 2000, 2004, 2006-2007, 2009-2018 Free Software Foundation,
Inc.
This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU 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/>. */
/* Written by Jim Meyering. */
@@ -32,7 +32,8 @@ __fpending (FILE *fp)
/* Most systems provide FILE as a struct and the necessary bitmask in
<stdio.h>, because they need it for implementing getc() and putc() as
fast macros. */
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1
+ /* GNU libc, BeOS, Haiku, Linux libc5 */
return fp->_IO_write_ptr - fp->_IO_write_base;
#elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
@@ -41,7 +42,7 @@ __fpending (FILE *fp)
return fp->_ptr - fp->_buffer;
#elif defined __minix /* Minix */
return fp_->_ptr - fp_->_buf;
-#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, MSVC, NonStop Kernel */
+#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, MSVC, NonStop Kernel, OpenVMS */
return (fp_->_ptr ? fp_->_ptr - fp_->_base : 0);
#elif defined __UCLIBC__ /* uClibc */
return (fp->__modeflags & __FLAG_WRITING ? fp->__bufpos - fp->__bufstart : 0);
@@ -51,8 +52,6 @@ __fpending (FILE *fp)
return fp->__bufp - fp->__buffer;
#elif defined EPLAN9 /* Plan9 */
return fp->wp - fp->buf;
-#elif defined __VMS /* VMS */
- return (*fp)->_ptr - (*fp)->_base;
#else
# error "Please port gnulib fpending.c to your platform!"
return 1;