]> git.ipfire.org Git - ipfire-2.x.git/blob - src/patches/m4-1.4.18-glibc-change-work-around.patch
suricata: Fix amount of listened nfqueues
[ipfire-2.x.git] / src / patches / m4-1.4.18-glibc-change-work-around.patch
1 diff -up m4-1.4.18/lib/fflush.c.orig m4-1.4.18/lib/fflush.c
2 --- m4-1.4.18/lib/fflush.c.orig 2018-05-02 12:35:59.536851666 +0200
3 +++ m4-1.4.18/lib/fflush.c 2018-05-02 12:37:02.768958606 +0200
4 @@ -33,7 +33,7 @@
5 #undef fflush
6
7
8 -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
9 +#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
10
11 /* Clear the stream's ungetc buffer, preserving the value of ftello (fp). */
12 static void
13 @@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
14
15 #endif
16
17 -#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
18 +#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
19
20 # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
21 /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
22 @@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
23 if (stream == NULL || ! freading (stream))
24 return fflush (stream);
25
26 -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
27 +#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
28
29 clear_ungetc_buffer_preserving_position (stream);
30
31 diff -up m4-1.4.18/lib/fpending.c.orig m4-1.4.18/lib/fpending.c
32 --- m4-1.4.18/lib/fpending.c.orig 2018-05-02 12:35:32.305806774 +0200
33 +++ m4-1.4.18/lib/fpending.c 2018-05-02 12:35:44.944827347 +0200
34 @@ -32,7 +32,7 @@ __fpending (FILE *fp)
35 /* Most systems provide FILE as a struct and the necessary bitmask in
36 <stdio.h>, because they need it for implementing getc() and putc() as
37 fast macros. */
38 -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
39 +#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
40 return fp->_IO_write_ptr - fp->_IO_write_base;
41 #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
42 /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
43 diff -up m4-1.4.18/lib/fpurge.c.orig m4-1.4.18/lib/fpurge.c
44 --- m4-1.4.18/lib/fpurge.c.orig 2018-05-02 12:38:13.586078669 +0200
45 +++ m4-1.4.18/lib/fpurge.c 2018-05-02 12:38:38.785121867 +0200
46 @@ -62,7 +62,7 @@ fpurge (FILE *fp)
47 /* Most systems provide FILE as a struct and the necessary bitmask in
48 <stdio.h>, because they need it for implementing getc() and putc() as
49 fast macros. */
50 -# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
51 +# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
52 fp->_IO_read_end = fp->_IO_read_ptr;
53 fp->_IO_write_ptr = fp->_IO_write_base;
54 /* Avoid memory leak when there is an active ungetc buffer. */
55 diff -up m4-1.4.18/lib/freadahead.c.orig m4-1.4.18/lib/freadahead.c
56 --- m4-1.4.18/lib/freadahead.c.orig 2016-12-31 14:54:41.000000000 +0100
57 +++ m4-1.4.18/lib/freadahead.c 2018-05-02 11:43:19.570336724 +0200
58 @@ -25,7 +25,7 @@
59 size_t
60 freadahead (FILE *fp)
61 {
62 -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
63 +#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
64 if (fp->_IO_write_ptr > fp->_IO_write_base)
65 return 0;
66 return (fp->_IO_read_end - fp->_IO_read_ptr)
67 diff -up m4-1.4.18/lib/freading.c.orig m4-1.4.18/lib/freading.c
68 --- m4-1.4.18/lib/freading.c.orig 2018-05-02 12:37:33.970011368 +0200
69 +++ m4-1.4.18/lib/freading.c 2018-05-02 12:37:59.393054359 +0200
70 @@ -31,7 +31,7 @@ freading (FILE *fp)
71 /* Most systems provide FILE as a struct and the necessary bitmask in
72 <stdio.h>, because they need it for implementing getc() and putc() as
73 fast macros. */
74 -# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
75 +# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
76 return ((fp->_flags & _IO_NO_WRITES) != 0
77 || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
78 && fp->_IO_read_base != NULL));
79 diff -up m4-1.4.18/lib/fseeko.c.orig m4-1.4.18/lib/fseeko.c
80 --- m4-1.4.18/lib/fseeko.c.orig 2018-05-02 11:44:17.947460233 +0200
81 +++ m4-1.4.18/lib/fseeko.c 2018-05-02 12:39:49.537216897 +0200
82 @@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int when
83 #endif
84
85 /* These tests are based on fpurge.c. */
86 -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
87 +#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
88 if (fp->_IO_read_end == fp->_IO_read_ptr
89 && fp->_IO_write_ptr == fp->_IO_write_base
90 && fp->_IO_save_base == NULL)
91 @@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int when
92 return -1;
93 }
94
95 -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
96 +#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
97 fp->_flags &= ~_IO_EOF_SEEN;
98 fp->_offset = pos;
99 #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
100 diff -up m4-1.4.18/lib/stdio-impl.h.orig m4-1.4.18/lib/stdio-impl.h
101 --- m4-1.4.18/lib/stdio-impl.h.orig 2016-12-31 14:54:42.000000000 +0100
102 +++ m4-1.4.18/lib/stdio-impl.h 2018-05-02 11:43:19.570336724 +0200
103 @@ -18,6 +18,12 @@
104 the same implementation of stdio extension API, except that some fields
105 have different naming conventions, or their access requires some casts. */
106
107 +/* Glibc 2.28 made _IO_IN_BACKUP private. For now, work around this
108 + problem by defining it ourselves. FIXME: Do not rely on glibc
109 + internals. */
110 +#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
111 +# define _IO_IN_BACKUP 0x100
112 +#endif
113
114 /* BSD stdio derived implementations. */
115