Author: dougm
Date: Sat Jun 22 19:27:09 2019
New Revision: 349293
URL: https://svnweb.freebsd.org/changeset/base/349293

Log:
  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

Modified:
  head/sbin/swapon/swapon.c

Modified: head/sbin/swapon/swapon.c
==============================================================================
--- head/sbin/swapon/swapon.c   Sat Jun 22 19:09:10 2019        (r349292)
+++ head/sbin/swapon/swapon.c   Sat Jun 22 19:27:09 2019        (r349293)
@@ -43,9 +43,8 @@ static char sccsid[] = "@(#)swapon.c  8.1 (Berkeley) 6/
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
-#include <sys/disk.h>
 #include <sys/param.h>
-#include <sys/types.h>
+#include <sys/disk.h>
 #include <sys/mdioctl.h>
 #include <sys/stat.h>
 #include <sys/sysctl.h>
@@ -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
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to