Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Nov 2019 14:11:25 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r354537 - head/sbin/newfs_msdos
Message-ID:  <201911081411.xA8EBPF9018539@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: emaste
Date: Fri Nov  8 14:11:25 2019
New Revision: 354537
URL: https://svnweb.freebsd.org/changeset/base/354537

Log:
  makefs: avoid warning when creating FAT filesystem on existing file
  
  Previously the mkfs_msdos function (from newfs_msdos) emitted warnings
  in the case that an image size is specified and the target is not a
  file, or no size is specified and the target is not a character device.
  The latter warning (not a character device) doesn't make sense when this
  code is used in makefs, regardless of whether an image size is specified
  or not.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sbin/newfs_msdos/mkfs_msdos.c

Modified: head/sbin/newfs_msdos/mkfs_msdos.c
==============================================================================
--- head/sbin/newfs_msdos/mkfs_msdos.c	Fri Nov  8 14:06:48 2019	(r354536)
+++ head/sbin/newfs_msdos/mkfs_msdos.c	Fri Nov  8 14:11:25 2019	(r354537)
@@ -285,8 +285,10 @@ mkfs_msdos(const char *fname, const char *dtype, const
 	if (!S_ISREG(sb.st_mode))
 	    warnx("warning, %s is not a regular file", fname);
     } else {
+#ifndef MAKEFS
 	if (!S_ISCHR(sb.st_mode))
 	    warnx("warning, %s is not a character device", fname);
+#endif
     }
     if (!o.no_create)
 	if (check_mounted(fname, sb.st_mode) == -1)



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