X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=pkt-line.c;h=c1e81f976f26726db2432f72f7356087a6e3a7d8;hb=5f468c4805c785115cd9c5f6a8f299f23a9034f5;hp=44d42969e558cf85aca41cf29604dcfda4ebaf7e;hpb=e94528a0e99ea54520b8aff016275a7622c55a47;p=git.git diff --git a/pkt-line.c b/pkt-line.c index 44d42969e..c1e81f976 100644 --- a/pkt-line.c +++ b/pkt-line.c @@ -16,8 +16,9 @@ * The writing side could use stdio, but since the reading * side can't, we stay with pure read/write interfaces. */ -static void safe_write(int fd, const void *buf, unsigned n) +ssize_t safe_write(int fd, const void *buf, ssize_t n) { + ssize_t nn = n; while (n) { int ret = xwrite(fd, buf, n); if (ret > 0) { @@ -29,6 +30,7 @@ static void safe_write(int fd, const void *buf, unsigned n) die("write error (disk full?)"); die("write error (%s)", strerror(errno)); } + return nn; } /*