summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2013-01-28 06:17:31 +0000
committerIgor Pashev <pashev.igor@gmail.com>2013-01-28 06:17:31 +0000
commitd9aaf6085968b1a3ef2febb0fabc604d860dd5b7 (patch)
treeb700f83d63c42f37e2cae95d2e4f6697e7f458e0
parent343c5a5e8c48ac8bad3b68ba9c2d876d67e2c36b (diff)
downloadicon-d9aaf6085968b1a3ef2febb0fabc604d860dd5b7.tar.gz
Use __fpending() from stdio_ext.h
-rw-r--r--debian/patches/series1
-rw-r--r--debian/patches/use-__fpending.patch36
2 files changed, 37 insertions, 0 deletions
diff --git a/debian/patches/series b/debian/patches/series
index c524d3e..98b6f03 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
debian-9.4.3-2.patch
config-illumos.patch
undefine-SHARED-if-defined.patch
+use-__fpending.patch
diff --git a/debian/patches/use-__fpending.patch b/debian/patches/use-__fpending.patch
new file mode 100644
index 0000000..b23fb04
--- /dev/null
+++ b/debian/patches/use-__fpending.patch
@@ -0,0 +1,36 @@
+Description: Supported in GLIBC and in Solaris libc
+Index: icon/ipl/cfuncs/fpoll.c
+===================================================================
+--- icon.orig/ipl/cfuncs/fpoll.c 2003-01-10 17:48:57.000000000 +0000
++++ icon/ipl/cfuncs/fpoll.c 2013-01-28 06:15:30.654169575 +0000
+@@ -29,6 +29,7 @@
+ */
+
+ #include <stdio.h>
++#include <stdio_ext.h>
+ #include <sys/types.h>
+ #include <sys/time.h>
+
+@@ -57,21 +58,8 @@
+ msec = IntegerVal(argv[2]);
+ }
+
+- /* check for data already in buffer */
+- /* there's no legal way to do this in C; we cheat */
+-#if defined(__GLIBC__) && defined(_STDIO_USES_IOSTREAM) /* new GCC library */
+- if (f->_IO_read_ptr < f->_IO_read_end)
++ if (__fpending(f))
+ RetArg(1);
+-#elif defined(__GLIBC__) /* old GCC library */
+- if (f->__bufp < f->__get_limit)
+- RetArg(1);
+-#elif defined(_FSTDIO) /* new BSD library */
+- if (f->_r > 0)
+- RetArg(1);
+-#else /* old AT&T library */
+- if (f->_cnt > 0)
+- RetArg(1);
+-#endif
+
+ /* set up select(2) structure */
+ FD_ZERO(&fds); /* clear file bits */