From 89fb9aeb55813dfecf385ede04c5b371bbd5e11e Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 16 Apr 2008 14:13:42 +0200 Subject: [PATCH] mkswap: set errno=0 in write_all() Signed-off-by: Karel Zak --- disk-utils/mkswap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) -- 2.39.5