~ Child side: we're a copy of connectd, so first shed every fd we * inherited (see dns_resolve_in_child), then touch nothing shared, make no * status_ calls (they'd impersonate connectd to lightningd) and never * return: only _exit(). */
| 341 | * status_ calls (they'd impersonate connectd to lightningd) and never |
| 342 | * return: only _exit(). */ |
| 343 | static bool write_all(int fd, const void *p, size_t len) |
| 344 | { |
| 345 | while (len != 0) { |
| 346 | ssize_t n = write(fd, p, len); |
| 347 | if (n <= 0) { |
| 348 | if (n < 0 && errno == EINTR) |
| 349 | continue; |
| 350 | return false; |
| 351 | } |
| 352 | p += n; |
| 353 | len -= n; |
| 354 | } |
| 355 | return true; |
| 356 | } |
| 357 | |
| 358 | static void dns_resolve_in_child(int fd, const char *hostname, u16 port) |
| 359 | { |
no outgoing calls