summaryrefslogtreecommitdiff
path: root/disk-utils/mkswap.c
diff options
context:
space:
mode:
authorKarel Zak <kzak@redhat.com>2008-04-16 14:13:42 +0200
committerKarel Zak <kzak@redhat.com>2008-04-16 21:58:26 +0200
commit89fb9aeb55813dfecf385ede04c5b371bbd5e11e (patch)
treeaa108607082974827034ca550cd9d433452c6666 /disk-utils/mkswap.c
parent3c52010c68c3d554979cca22a529aed15794eb80 (diff)
downloadutil-linux-old-89fb9aeb55813dfecf385ede04c5b371bbd5e11e.tar.gz
mkswap: set errno=0 in write_all()
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'disk-utils/mkswap.c')
-rw-r--r--disk-utils/mkswap.c4
1 files changed, 3 insertions, 1 deletions
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)