/* See LICENSE file for copyright and license details. */ #include "common.h" void writeall(int fd, const void *data, size_t n, const char *fname) { const char *text = data; ssize_t r; while (n) { r = write(fd, text, n); if (r < 0) { if (errno == EINTR) continue; eprintf("write %s:", fname); } n -= (size_t)r; text = &text[r]; } }