summaryrefslogtreecommitdiffstats
path: root/mount
diff options
context:
space:
mode:
authorKarel Zak2009-03-05 20:59:30 +0100
committerKarel Zak2009-03-05 20:59:30 +0100
commit5dd53f43b22b4d7dcc97c633fe058723439d649d (patch)
treeeaa0cd27889e76bdb3a3b10151c9b13b64ead0c5 /mount
parentswapon: fix typo s/warn/warnx/ (diff)
downloadkernel-qcow2-util-linux-5dd53f43b22b4d7dcc97c633fe058723439d649d.tar.gz
kernel-qcow2-util-linux-5dd53f43b22b4d7dcc97c633fe058723439d649d.tar.xz
kernel-qcow2-util-linux-5dd53f43b22b4d7dcc97c633fe058723439d649d.zip
swapon: add error messages for lseek and write
Thanks to Hugh Dickins. Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'mount')
-rw-r--r--mount/swapon.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/mount/swapon.c b/mount/swapon.c
index e342293d7..55933b101 100644
--- a/mount/swapon.c
+++ b/mount/swapon.c
@@ -246,12 +246,16 @@ swap_rewrite_signature(const char *devname, unsigned int pagesize)
return -1;
}
- if (lseek(fd, pagesize - SWAP_SIGNATURE_SZ, SEEK_SET) < 0)
+ if (lseek(fd, pagesize - SWAP_SIGNATURE_SZ, SEEK_SET) < 0) {
+ warn(_("%s: lseek failed"), devname);
goto err;
+ }
if (write(fd, (void *) SWAP_SIGNATURE,
- SWAP_SIGNATURE_SZ) != SWAP_SIGNATURE_SZ)
+ SWAP_SIGNATURE_SZ) != SWAP_SIGNATURE_SZ) {
+ warn(_("%s: write signature failed"), devname);
goto err;
+ }
rc = 0;
err: