summaryrefslogtreecommitdiffstats
path: root/sys-utils/swapon.c
diff options
context:
space:
mode:
authorSami Kerola2017-05-28 11:21:48 +0200
committerKarel Zak2017-06-14 12:19:20 +0200
commit1b5042636fa92c977d9a033f685ceb7f3c4c5fc9 (patch)
tree39b83786d289855a5ba6cb51fe0ac10e2707e481 /sys-utils/swapon.c
parentisosize: avoid reading more data than what is needed (diff)
downloadkernel-qcow2-util-linux-1b5042636fa92c977d9a033f685ceb7f3c4c5fc9.tar.gz
kernel-qcow2-util-linux-1b5042636fa92c977d9a033f685ceb7f3c4c5fc9.tar.xz
kernel-qcow2-util-linux-1b5042636fa92c977d9a033f685ceb7f3c4c5fc9.zip
misc: fix reassigned values before old ones has been used [cppcheck]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'sys-utils/swapon.c')
-rw-r--r--sys-utils/swapon.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys-utils/swapon.c b/sys-utils/swapon.c
index f4ca781d8..6bd057dd2 100644
--- a/sys-utils/swapon.c
+++ b/sys-utils/swapon.c
@@ -501,7 +501,7 @@ static void swap_get_info(struct swap_device *dev, const char *hdr)
static int swapon_checks(const struct swapon_ctl *ctl, struct swap_device *dev)
{
struct stat st;
- int fd = -1, sig;
+ int fd, sig;
char *hdr = NULL;
unsigned long long devsize = 0;
int permMask;