Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Jun 2019 19:27:09 +0000 (UTC)
From:      Doug Moore <dougm@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r349293 - head/sbin/swapon
Message-ID:  <201906221927.x5MJR9is003791@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201906221927.x5MJR9is003791>