diff options
author | Sami Kerola | 2013-04-13 21:55:00 +0200 |
---|---|---|
committer | Karel Zak | 2013-04-26 13:26:07 +0200 |
commit | 14699715351070b8b6165d8780d7d5c1d3cdb5b1 (patch) | |
tree | 8c53dae46f201d8fedbf74d9fd15f599d0a6c564 /sys-utils | |
parent | setpriv: check writing to a file descriptor was successful (diff) | |
download | kernel-qcow2-util-linux-14699715351070b8b6165d8780d7d5c1d3cdb5b1.tar.gz kernel-qcow2-util-linux-14699715351070b8b6165d8780d7d5c1d3cdb5b1.tar.xz kernel-qcow2-util-linux-14699715351070b8b6165d8780d7d5c1d3cdb5b1.zip |
swapon: check writing to a file descriptor was successful
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'sys-utils')
-rw-r--r-- | sys-utils/swapon.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys-utils/swapon.c b/sys-utils/swapon.c index d5b7e3789..f1e243375 100644 --- a/sys-utils/swapon.c +++ b/sys-utils/swapon.c @@ -323,7 +323,10 @@ static int swap_rewrite_signature(const char *devname, unsigned int pagesize) rc = 0; err: - close(fd); + if (close_fd(fd) != 0) { + warn(_("write failed: %s"), devname); + rc = -1; + } return rc; } |