Check for a valid pagesize in mkswap(8)
This commit is contained in:
parent
9c37575961
commit
41769b976a
7
mkswap.c
7
mkswap.c
@ -45,7 +45,12 @@ main(int argc, char *argv[])
|
||||
if (argc < 1)
|
||||
usage();
|
||||
|
||||
pagesize = sysconf(_SC_PAGE_SIZE);
|
||||
pagesize = sysconf(_SC_PAGESIZE);
|
||||
if (pagesize <= 0) {
|
||||
pagesize = sysconf(_SC_PAGE_SIZE);
|
||||
if (pagesize <= 0)
|
||||
enprintf(EXIT_FAILURE, "can't determine pagesize\n");
|
||||
}
|
||||
|
||||
fd = open(argv[0], O_RDWR);
|
||||
if (fd < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user