1 diff -r -U3 coreutils-8.5/lib/freadahead.c coreutils-8.5-patched/lib/freadahead.c
2 --- coreutils-8.5/lib/freadahead.c 2010-04-23 07:44:00.000000000 -0600
3 +++ coreutils-8.5-patched/lib/freadahead.c 2019-08-01 18:35:31.580843463 -0600
8 -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
9 +#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
10 if (fp->_IO_write_ptr > fp->_IO_write_base)
12 return (fp->_IO_read_end - fp->_IO_read_ptr)
13 diff -r -U3 coreutils-8.5/lib/freadptr.c coreutils-8.5-patched/lib/freadptr.c
14 --- coreutils-8.5/lib/freadptr.c 2010-04-23 07:44:00.000000000 -0600
15 +++ coreutils-8.5-patched/lib/freadptr.c 2019-08-01 18:35:31.580843463 -0600
19 /* Keep this code in sync with freadahead! */
20 -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
21 +#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
22 if (fp->_IO_write_ptr > fp->_IO_write_base)
24 size = fp->_IO_read_end - fp->_IO_read_ptr;
25 diff -r -U3 coreutils-8.5/lib/freadseek.c coreutils-8.5-patched/lib/freadseek.c
26 --- coreutils-8.5/lib/freadseek.c 2010-04-23 07:44:00.000000000 -0600
27 +++ coreutils-8.5-patched/lib/freadseek.c 2019-08-01 18:35:31.580843463 -0600
29 freadptrinc (FILE *fp, size_t increment)
31 /* Keep this code in sync with freadptr! */
32 -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
33 +#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
34 fp->_IO_read_ptr += increment;
35 #elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */
37 diff -r -U3 coreutils-8.5/lib/fseeko.c coreutils-8.5-patched/lib/fseeko.c
38 --- coreutils-8.5/lib/fseeko.c 2010-04-21 12:11:48.000000000 -0600
39 +++ coreutils-8.5-patched/lib/fseeko.c 2019-08-01 18:35:31.580843463 -0600
43 /* These tests are based on fpurge.c. */
44 -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
45 +#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
46 if (fp->_IO_read_end == fp->_IO_read_ptr
47 && fp->_IO_write_ptr == fp->_IO_write_base
48 && fp->_IO_save_base == NULL)
49 diff -r -U3 coreutils-8.5/lib/fseterr.c coreutils-8.5-patched/lib/fseterr.c
50 --- coreutils-8.5/lib/fseterr.c 2010-04-23 07:44:00.000000000 -0600
51 +++ coreutils-8.5-patched/lib/fseterr.c 2019-08-01 18:35:31.584843515 -0600
53 /* Most systems provide FILE as a struct and the necessary bitmask in
54 <stdio.h>, because they need it for implementing getc() and putc() as
56 -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
57 +#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
58 fp->_flags |= _IO_ERR_SEEN;
59 #elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */
60 fp_->_flags |= __SERR;
61 diff -r -U3 coreutils-8.5/lib/stdio-impl.h coreutils-8.5-patched/lib/stdio-impl.h
62 --- coreutils-8.5/lib/stdio-impl.h 2010-04-23 07:44:01.000000000 -0600
63 +++ coreutils-8.5-patched/lib/stdio-impl.h 2019-08-01 18:35:31.584843515 -0600
65 the same implementation of stdio extension API, except that some fields
66 have different naming conventions, or their access requires some casts. */
68 +/* Glibc 2.28 made _IO_IN_BACKUP private. For now, work around this
69 + * problem by defining it ourselves. FIXME: Do not rely on glibc
71 +#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
72 +# define _IO_IN_BACKUP 0x100
75 /* BSD stdio derived implementations. */
77 diff -r -U3 coreutils-8.5/lib/stdio.in.h coreutils-8.5-patched/lib/stdio.in.h
78 --- coreutils-8.5/lib/stdio.in.h 2010-04-21 12:11:57.000000000 -0600
79 +++ coreutils-8.5-patched/lib/stdio.in.h 2019-08-01 18:26:34.113941755 -0600
81 so any use of gets warrants an unconditional warning. Assume it is
82 always declared, since it is required by C89. */
84 -_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
85 +/*_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");*/