From owner-svn-src-head@freebsd.org Fri Nov 8 14:11:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D02B21B3A11; Fri, 8 Nov 2019 14:11:25 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478hyj5BT3z4PtV; Fri, 8 Nov 2019 14:11:25 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9601627267; Fri, 8 Nov 2019 14:11:25 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA8EBP0o018540; Fri, 8 Nov 2019 14:11:25 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA8EBPF9018539; Fri, 8 Nov 2019 14:11:25 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201911081411.xA8EBPF9018539@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 8 Nov 2019 14:11:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354537 - head/sbin/newfs_msdos X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sbin/newfs_msdos X-SVN-Commit-Revision: 354537 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 14:11:25 -0000 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)