| 1403 | } |
| 1404 | |
| 1405 | static int pump_io(struct io_pump *slots, int nr) |
| 1406 | { |
| 1407 | struct pollfd *pfd; |
| 1408 | int i; |
| 1409 | |
| 1410 | for (i = 0; i < nr; i++) |
| 1411 | slots[i].error = 0; |
| 1412 | |
| 1413 | ALLOC_ARRAY(pfd, nr); |
| 1414 | while (pump_io_round(slots, nr, pfd)) |
| 1415 | ; /* nothing */ |
| 1416 | free(pfd); |
| 1417 | |
| 1418 | /* There may be multiple errno values, so just pick the first. */ |
| 1419 | for (i = 0; i < nr; i++) { |
| 1420 | if (slots[i].error) { |
| 1421 | errno = slots[i].error; |
| 1422 | return -1; |
| 1423 | } |
| 1424 | } |
| 1425 | return 0; |
| 1426 | } |
| 1427 | |
| 1428 | |
| 1429 | int pipe_command(struct child_process *cmd, |
no test coverage detected