| 56 | } |
| 57 | |
| 58 | static int with_socketpair(void (*fn)(int, int)) |
| 59 | { |
| 60 | int fds[2]; |
| 61 | if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds) < 0) { |
| 62 | fail("socketpair failed"); |
| 63 | return -1; |
| 64 | } |
| 65 | fn(fds[0], fds[1]); |
| 66 | close(fds[0]); |
| 67 | close(fds[1]); |
| 68 | return 0; |
| 69 | } |
| 70 | |
| 71 | static void drain_read(int fd) |
| 72 | { |
no test coverage detected
searching dependent graphs…