Commit 624ea288 authored by Daiki Ueno's avatar Daiki Ueno

pipe-filter-gi, pipe-filter-ii: port to AIX

On AIX 7.1, 'select' is defined as static and cannot be referred
to from inline function.
* lib/pipe-filter-aux.h (nointr_select): Remove, manually expand
the definition...
* lib/pipe-filter-gi.c (filter_loop): ...here, and...
* lib/pipe-filter-ii.c (pipe_filter_ii_execute): ...here.
parent 6dd16adf
2014-11-22 Daiki Ueno <ueno@gnu.org>
pipe-filter-gi, pipe-filter-ii: port to AIX
On AIX 7.1, 'select' is defined as static and cannot be referred
to from inline function.
* lib/pipe-filter-aux.h (nointr_select): Remove, manually expand
the definition...
* lib/pipe-filter-gi.c (filter_loop): ...here, and...
* lib/pipe-filter-ii.c (pipe_filter_ii_execute): ...here.
2014-11-20 Paul Eggert <eggert@cs.ucla.edu>
gitlog-to-changelog: add --until
......@@ -87,25 +87,6 @@ nonintr_write (int fd, const void *buf, size_t count)
#undef write /* avoid warning on VMS */
#define write nonintr_write
# if HAVE_SELECT
PIPE_FILTER_AUX_INLINE int
nonintr_select (int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
struct timeval *timeout)
{
int retval;
do
retval = select (n, readfds, writefds, exceptfds, timeout);
while (retval < 0 && errno == EINTR);
return retval;
}
# undef select /* avoid warning on VMS */
# define select nonintr_select
# endif
#endif
/* Non-blocking I/O. */
......
......@@ -302,7 +302,7 @@ filter_loop (struct pipe_filter_gi *filter, const char *wbuf, size_t count)
/* Here, if done_writing, filter->reader_terminated is false. When
filter->reader_terminated becomes true, this loop is terminated. */
# if HAVE_SELECT
int n;
int n, retval;
/* See whether reading or writing is possible. */
n = 1;
......@@ -317,10 +317,16 @@ filter_loop (struct pipe_filter_gi *filter, const char *wbuf, size_t count)
if (n <= filter->fd[1])
n = filter->fd[1] + 1;
}
n = select (n,
(!filter->reader_terminated ? &filter->readfds : NULL),
(!done_writing ? &filter->writefds : NULL),
NULL, NULL);
/* Do EINTR handling here instead of in pipe-filter-aux.h,
because select() cannot be referred to from an inline
function on AIX 7.1. */
do
retval = select (n,
(!filter->reader_terminated ? &filter->readfds : NULL),
(!done_writing ? &filter->writefds : NULL),
NULL, NULL);
while (retval < 0 && errno == EINTR);
n = retval;
if (n < 0)
{
......
......@@ -309,7 +309,7 @@ pipe_filter_ii_execute (const char *progname,
for (;;)
{
# if HAVE_SELECT
int n;
int n, retval;
FD_SET (fd[0], &readfds);
n = fd[0] + 1;
......@@ -320,8 +320,15 @@ pipe_filter_ii_execute (const char *progname,
n = fd[1] + 1;
}
n = select (n, &readfds, (!done_writing ? &writefds : NULL), NULL,
NULL);
/* Do EINTR handling here instead of in pipe-filter-aux.h,
because select() cannot be referred to from an inline
function on AIX 7.1. */
do
retval = select (n, &readfds, (!done_writing ? &writefds : NULL),
NULL, NULL);
while (retval < 0 && errno == EINTR);
n = retval;
if (n < 0)
{
if (exit_on_error)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment