Index: swapon.c =================================================================== --- swapon.c +++ swapon.c @@ -43,9 +43,8 @@ #include __FBSDID("$FreeBSD$"); +#include #include -#include -#include #include #include #include @@ -754,7 +753,7 @@ 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