1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
diff -r -U3 coreutils-6.11/lib/freadahead.c coreutils-6.11-patched/lib/freadahead.c
--- coreutils-6.11/lib/freadahead.c 2008-04-17 03:59:17.000000000 -0600
+++ coreutils-6.11-patched/lib/freadahead.c 2019-08-01 20:20:12.712193242 -0600
@@ -19,10 +19,17 @@
/* Specification. */
#include "freadahead.h"
+/* Glibc 2.28 made _IO_IN_BACKUP private. For now, work around this
+ * problem by defining it ourselves. FIXME: Do not rely on glibc
+ * internals. */
+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
+# define _IO_IN_BACKUP 0x100
+#endif
+
size_t
freadahead (FILE *fp)
{
-#if defined _IO_ferror_unlocked || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Linux libc5 */
+#if defined _IO_EOF_SEEN || defined _IO_ferror_unlocked || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Linux libc5 */
if (fp->_IO_write_ptr > fp->_IO_write_base)
return 0;
return (fp->_IO_read_end - fp->_IO_read_ptr)
diff -r -U3 coreutils-6.11/lib/fseterr.c coreutils-6.11-patched/lib/fseterr.c
--- coreutils-6.11/lib/fseterr.c 2008-04-17 03:59:17.000000000 -0600
+++ coreutils-6.11-patched/lib/fseterr.c 2019-08-01 20:20:37.868480486 -0600
@@ -27,7 +27,7 @@
/* 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_ferror_unlocked || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Linux libc5 */
+#if defined _IO_EOF_SEEN || defined _IO_ferror_unlocked || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Linux libc5 */
fp->_flags |= _IO_ERR_SEEN;
#elif defined __sferror /* FreeBSD, NetBSD, OpenBSD, MacOS X, Cygwin */
fp->_flags |= __SERR;
|