=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/signify/signify.c,v retrieving revision 1.37 retrieving revision 1.38 diff -c -r1.37 -r1.38 *** src/usr.bin/signify/signify.c 2014/01/14 21:34:30 1.37 --- src/usr.bin/signify/signify.c 2014/01/15 00:31:34 1.38 *************** *** 1,4 **** ! /* $OpenBSD: signify.c,v 1.37 2014/01/14 21:34:30 tedu Exp $ */ /* * Copyright (c) 2013 Ted Unangst * --- 1,4 ---- ! /* $OpenBSD: signify.c,v 1.38 2014/01/15 00:31:34 espie Exp $ */ /* * Copyright (c) 2013 Ted Unangst * *************** *** 120,131 **** readall(int fd, void *buf, size_t len, const char *filename) { ssize_t x; ! ! x = read(fd, buf, len); ! if (x == -1) { ! err(1, "read from %s", filename); ! } else if (x != len) { ! errx(1, "short read from %s", filename); } } --- 120,134 ---- readall(int fd, void *buf, size_t len, const char *filename) { ssize_t x; ! ! while (len != 0) { ! x = read(fd, buf, len); ! if (x == -1) ! err(1, "read from %s", filename); ! else { ! len -= x; ! buf = (char*)buf + x; ! } } } *************** *** 200,211 **** writeall(int fd, const void *buf, size_t len, const char *filename) { ssize_t x; ! ! x = write(fd, buf, len); ! if (x == -1) { ! err(1, "write to %s", filename); ! } else if (x != len) { ! errx(1, "short write to %s", filename); } } --- 203,217 ---- writeall(int fd, const void *buf, size_t len, const char *filename) { ssize_t x; ! ! while (len != 0) { ! x = write(fd, buf, len); ! if (x == -1) ! err(1, "write to %s", filename); ! else { ! len -= x; ! buf = (char*)buf + x; ! } } }