From d9aaf6085968b1a3ef2febb0fabc604d860dd5b7 Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Mon, 28 Jan 2013 06:17:31 +0000 Subject: Use __fpending() from stdio_ext.h --- debian/patches/series | 1 + debian/patches/use-__fpending.patch | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 debian/patches/use-__fpending.patch 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 ++#include + #include + #include + +@@ -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 */ -- cgit v1.2.3