Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / gnulib-lib / pipe-filter-ii.c
index 8951f2e..88b0d0d 100644 (file)
@@ -1,5 +1,5 @@
 /* Filtering of data through a subprocess.
-   Copyright (C) 2001-2003, 2008-2013 Free Software Foundation, Inc.
+   Copyright (C) 2001-2003, 2008-2015 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2009.
 
    This program is free software: you can redistribute it and/or modify
@@ -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)