summaryrefslogtreecommitdiff
path: root/scripts/build-older-versions/coreutils-8.18-on-glibc-2.28.diff
blob: 81e72a30d868297bafcfcabefa07a8522a98161c (plain)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
diff -r -U3 coreutils-8.18/lib/freadahead.c coreutils-8.18-patched/lib/freadahead.c
--- coreutils-8.18/lib/freadahead.c	2012-07-15 06:26:12.000000000 -0600
+++ coreutils-8.18-patched/lib/freadahead.c	2019-08-01 19:22:13.169332844 -0600
@@ -25,7 +25,7 @@
 size_t
 freadahead (FILE *fp)
 {
-#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 */
   if (fp->_IO_write_ptr > fp->_IO_write_base)
     return 0;
   return (fp->_IO_read_end - fp->_IO_read_ptr)
diff -r -U3 coreutils-8.18/lib/freadptr.c coreutils-8.18-patched/lib/freadptr.c
--- coreutils-8.18/lib/freadptr.c	2012-07-15 06:26:12.000000000 -0600
+++ coreutils-8.18-patched/lib/freadptr.c	2019-08-01 19:22:13.169332844 -0600
@@ -29,7 +29,7 @@
   size_t size;

   /* Keep this code in sync with freadahead!  */
-#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 */
   if (fp->_IO_write_ptr > fp->_IO_write_base)
     return NULL;
   size = fp->_IO_read_end - fp->_IO_read_ptr;
diff -r -U3 coreutils-8.18/lib/freadseek.c coreutils-8.18-patched/lib/freadseek.c
--- coreutils-8.18/lib/freadseek.c	2012-07-15 06:26:12.000000000 -0600
+++ coreutils-8.18-patched/lib/freadseek.c	2019-08-01 19:23:20.070111747 -0600
@@ -36,7 +36,7 @@
   /* Keep this code in sync with freadptr!  */
 #if HAVE___FREADPTRINC              /* musl libc */
   __freadptrinc (fp, increment);
-#elif defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#elif defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
   fp->_IO_read_ptr += increment;
 #elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin */
   fp_->_p += increment;
diff -r -U3 coreutils-8.18/lib/fseeko.c coreutils-8.18-patched/lib/fseeko.c
--- coreutils-8.18/lib/fseeko.c	2012-07-13 08:18:33.000000000 -0600
+++ coreutils-8.18-patched/lib/fseeko.c	2019-08-01 19:22:13.169332844 -0600
@@ -47,7 +47,7 @@
 #endif

   /* These tests are based on fpurge.c.  */
-#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 */
   if (fp->_IO_read_end == fp->_IO_read_ptr
       && fp->_IO_write_ptr == fp->_IO_write_base
       && fp->_IO_save_base == NULL)
diff -r -U3 coreutils-8.18/lib/fseterr.c coreutils-8.18-patched/lib/fseterr.c
--- coreutils-8.18/lib/fseterr.c	2012-07-15 06:26:12.000000000 -0600
+++ coreutils-8.18-patched/lib/fseterr.c	2019-08-01 19:22:13.169332844 -0600
@@ -29,7 +29,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_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 */
   fp->_flags |= _IO_ERR_SEEN;
 #elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin */
   fp_->_flags |= __SERR;
diff -r -U3 coreutils-8.18/lib/stdio-impl.h coreutils-8.18-patched/lib/stdio-impl.h
--- coreutils-8.18/lib/stdio-impl.h	2012-07-15 06:26:12.000000000 -0600
+++ coreutils-8.18-patched/lib/stdio-impl.h	2019-08-01 19:22:13.169332844 -0600
@@ -18,6 +18,12 @@
    the same implementation of stdio extension API, except that some fields
    have different naming conventions, or their access requires some casts.  */

+/* 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

 /* BSD stdio derived implementations.  */

diff -r -U3 coreutils-8.18/lib/stdio.in.h coreutils-8.18-patched/lib/stdio.in.h
--- coreutils-8.18/lib/stdio.in.h	2012-06-12 14:43:46.000000000 -0600
+++ coreutils-8.18-patched/lib/stdio.in.h	2019-08-01 19:22:13.169332844 -0600
@@ -704,7 +704,7 @@
    removed it.  */
 #undef gets
 #if HAVE_RAW_DECL_GETS
-_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+/*_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");*/
 #endif