| 187 | } |
| 188 | |
| 189 | static void close_taken_fds(va_list *ap) |
| 190 | { |
| 191 | int *fd; |
| 192 | |
| 193 | while ((fd = va_arg(*ap, int *)) != NULL) { |
| 194 | if (taken(fd) && *fd >= 0) { |
| 195 | close(*fd); |
| 196 | *fd = -1; |
| 197 | } |
| 198 | } |
| 199 | } |
| 200 | |
| 201 | /* We use sockets, not pipes, because fds are bidir. */ |
| 202 | static int subd(const char *path, const char *name, |