From 9b5698e754e20fe90b90401f8e1f0a7bc08e8574 Mon Sep 17 00:00:00 2001 From: dougm Date: Sat, 22 Jun 2019 19:27:09 +0000 Subject: [PATCH] You can't use block special nodes for swap, so don't let that happen. Fix a style violation with regard to header file arrangement. Improved by: alc Approved by: markj, kib (mentor) Differential Revision: https://reviews.freebsd.org/D20723 --- sbin/swapon/swapon.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sbin/swapon/swapon.c b/sbin/swapon/swapon.c index c8904ade5a8f..e6c8b7eb215d 100644 --- a/sbin/swapon/swapon.c +++ b/sbin/swapon/swapon.c @@ -43,9 +43,8 @@ static char sccsid[] = "@(#)swapon.c 8.1 (Berkeley) 6/5/93"; #include __FBSDID("$FreeBSD$"); -#include #include -#include +#include #include #include #include @@ -754,7 +753,7 @@ swap_trim(const char *name) errx(1, "Cannot stat %s", name); if (S_ISREG(sb.st_mode)) sz = sb.st_size; - else if (S_ISCHR(sb.st_mode) || S_ISBLK(sb.st_mode)) { + else if (S_ISCHR(sb.st_mode)) { if (ioctl(fd, DIOCGMEDIASIZE, &sz) != 0) err(1, "ioctl(DIOCGMEDIASIZE)"); } else