MCPcopy Create free account
hub / github.com/ElementsProject/lightning / write_all

Function write_all

connectd/dns.c:343–356  ·  view source on GitHub ↗

~ 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(). */

Source from the content-addressed store, hash-verified

341 * status_ calls (they'd impersonate connectd to lightningd) and never
342 * return: only _exit(). */
343static 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
358static void dns_resolve_in_child(int fd, const char *hostname, u16 port)
359{

Callers 15

websocketd.cFile · 0.70
http_respondFunction · 0.70
lightningd_to_websocketFunction · 0.70
websocket_to_lightningdFunction · 0.70
tor_send_cmdFunction · 0.70
dns_resolve_in_childFunction · 0.70
writexFunction · 0.50
make_new_gossip_storeFunction · 0.50
gossip_store_upgradeFunction · 0.50
compactd_read_doneFunction · 0.50
create_hsmFunction · 0.50
opt_set_hsm_secretFunction · 0.50

Calls

no outgoing calls

Tested by 6

mainFunction · 0.40
mainFunction · 0.40
mainFunction · 0.40
mainFunction · 0.40
test_flow_to_routeFunction · 0.40