From: Karel Zak Date: Wed, 16 Apr 2008 12:13:42 +0000 (+0200) Subject: mkswap: set errno=0 in write_all() X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=89fb9aeb55813dfecf385ede04c5b371bbd5e11e;p=util-linux mkswap: set errno=0 in write_all() Signed-off-by: Karel Zak --- diff --git a/disk-utils/mkswap.c b/disk-utils/mkswap.c index dc3a3d30..10068b71 100644 --- a/disk-utils/mkswap.c +++ b/disk-utils/mkswap.c @@ -469,8 +469,10 @@ check_mount(void) { static int write_all(int fd, const void *buf, size_t count) { while(count) { - ssize_t tmp = write(fd, buf, count); + ssize_t tmp; + errno = 0; + tmp = write(fd, buf, count); if (tmp > 0) { count -= tmp; if (count)