diff options
Diffstat (limited to 'sys-utils/swapon.c')
-rw-r--r-- | sys-utils/swapon.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sys-utils/swapon.c b/sys-utils/swapon.c index 3866ee70d..6c422ce41 100644 --- a/sys-utils/swapon.c +++ b/sys-utils/swapon.c @@ -402,21 +402,19 @@ static unsigned long long swap_get_size(const char *hdr, const char *devname, unsigned int pagesize) { unsigned int last_page = 0; - int swap_version = 0; + const unsigned int swap_version = SWAP_VERSION; int flip = 0; struct swap_header_v1_2 *s; s = (struct swap_header_v1_2 *) hdr; - if (s->version == 1) { - swap_version = 1; + if (s->version == swap_version) { last_page = s->last_page; - } else if (swab32(s->version) == 1) { + } else if (swab32(s->version) == swap_version) { flip = 1; - swap_version = 1; last_page = swab32(s->last_page); } if (verbose) - warnx(_("%s: found swap signature: version %d, " + warnx(_("%s: found swap signature: version %ud, " "page-size %d, %s byte order"), devname, swap_version, |