summaryrefslogtreecommitdiffstats
path: root/Grow.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2006-05-29 02:06:32 +0000
committerNeil Brown <neilb@suse.de>2006-05-29 02:06:32 +0000
commit9fca7d6236e9775d0269b9802f740c08db46f4d7 (patch)
treeaef0c99d844a3eacf037294e6722079c01c44ae9 /Grow.c
parent280a927d3d8da258a70df13df4f780d823fc1da2 (diff)
downloadmdadm-9fca7d6236e9775d0269b9802f740c08db46f4d7.tar.gz
mdadm-9fca7d6236e9775d0269b9802f740c08db46f4d7.tar.xz
mdadm-9fca7d6236e9775d0269b9802f740c08db46f4d7.zip
check return status of all write/fwrite functions as required by glibc 2.4
From: Luca Berra <bluca@vodka.it> glibc 2.4 is pedantic on ignoring return values from fprintf, fwrite and write, so now we check the rval and actually do something with it. in the Grow.c case i only print a warning, since i don't think we can do anything in case we fail invalidating those superblocks (is should never happen, but then...) Signed-off-by: Neil Brown <neilb@suse.de>
Diffstat (limited to 'Grow.c')
-rw-r--r--Grow.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Grow.c b/Grow.c
index 8c8aa28..61347b7 100644
--- a/Grow.c
+++ b/Grow.c
@@ -801,7 +801,10 @@ int Grow_reshape(char *devname, int fd, int quiet, char *backup_file,
memset(&bsb, 0, sizeof(bsb));
for (i=odisks; i<d ; i++) {
lseek64(fdlist[i], (offsets[i]+last_block)<<9, 0);
- write(fdlist[i], &bsb, sizeof(bsb));
+ if (write(fdlist[i], &bsb, sizeof(bsb)) < 0) {
+ fprintf(stderr, Name ": %s: failed to invalidate metadata for raid disk %d\n",
+ devname, i);
+ }
}
/* unsuspend. */