| 193 | or -1 if all are null. */ |
| 194 | |
| 195 | ATTRIBUTE_PURE |
| 196 | static int |
| 197 | get_next_out (int *descriptors, int nfiles, int idx) |
| 198 | { |
| 199 | for (idx++; idx <= nfiles; idx++) |
| 200 | if (0 <= descriptors[idx]) |
| 201 | return idx; |
| 202 | return -1; /* no outputs remaining */ |
| 203 | } |
| 204 | |
| 205 | /* Remove descriptors[i] due to write failure or broken pipe. |
| 206 | Return true if this indicates a reportable error. */ |