From: Karel Zak Date: Thu, 5 Mar 2009 19:59:30 +0000 (+0100) Subject: swapon: add error messages for lseek and write X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5dd53f43b22b4d7dcc97c633fe058723439d649d;p=util-linux swapon: add error messages for lseek and write Thanks to Hugh Dickins. Signed-off-by: Karel Zak --- diff --git a/mount/swapon.c b/mount/swapon.c index e342293d..55933b10 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: