| 6 | #include <wire/wire_sync.h> |
| 7 | |
| 8 | bool wire_sync_write(int fd, const void *msg TAKES) |
| 9 | { |
| 10 | wire_len_t hdr = cpu_to_wirelen(tal_bytelen(msg)); |
| 11 | bool ret; |
| 12 | |
| 13 | assert(tal_bytelen(msg) < WIRE_LEN_LIMIT); |
| 14 | ret = write_all(fd, &hdr, sizeof(hdr)) |
| 15 | && write_all(fd, msg, tal_count(msg)); |
| 16 | |
| 17 | if (taken(msg)) |
| 18 | tal_free(msg); |
| 19 | return ret; |
| 20 | } |
| 21 | |
| 22 | u8 *wire_sync_read(const tal_t *ctx, int fd) |
| 23 | { |
no test coverage detected