blob: d621a23d2f42a23f9e616c6e0bcb1b1f5702390a (
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
|
Inspired by https://github.com/gentoo/gentoo/commit/cd306dc1d9273c423759a74166f9805ac8e8b5dd
Fix fpurge on musl
https://bugs.gentoo.org/936285
--- a/configure.ac
+++ b/configure.ac
@@ -316,7 +316,7 @@
# tiocflush use TIOCFLUSH ioctl from <sys/ioctl.h>
# tcflsh use TCFLSH ioctl from <termio.h>
# Leave the variable(s) empty if flushing is not supported.
-AC_CHECK_FUNCS(fpurge)
+AC_CHECK_DECLS(fpurge)
AC_CACHE_CHECK([for BSD-style flushing],
[ac_cv_have_bsd_flush],
--- a/src/print.c
+++ b/src/print.c
@@ -205,7 +205,7 @@
if (PORT(port)->flags & P_STRING)
return;
f = PORT(port)->file;
-#if defined(HAVE_FPURGE)
+#if HAVE_DELC_FPURGE
(void)fpurge (f);
#elif defined(HAVE_BSD_FLUSH)
f->_cnt = 0;
--- a/src/read.c
+++ b/src/read.c
@@ -144,7 +144,7 @@
if (PORT(port)->flags & P_STRING)
return;
f = PORT(port)->file;
-#if defined(HAVE_FPURGE)
+#if HAVE_DECL_FPURGE
(void)fpurge (f);
#elif defined(HAVE_BSD_FLUSH)
f->_cnt = 0;
|