blob: 2e3d1ade6057aaf228b217996c5887902cd21b21 (
plain) (
tree)
|
|
/* 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];
}
}
|