Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Apr 2009 14:53:32 +0000 (UTC)
From:      Ed Schouten <ed@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r190931 - head/sbin/newfs_msdos
Message-ID:  <200904111453.n3BErWgc089632@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ed
Date: Sat Apr 11 14:53:32 2009
New Revision: 190931
URL: http://svn.freebsd.org/changeset/base/190931

Log:
  When using -C, do not warn when the file is not a character device, but warn when it is not a regular file.
  
  Submitted by:	Christoph Mallon <christoph mallon gmx de>

Modified:
  head/sbin/newfs_msdos/newfs_msdos.c

Modified: head/sbin/newfs_msdos/newfs_msdos.c
==============================================================================
--- head/sbin/newfs_msdos/newfs_msdos.c	Sat Apr 11 14:43:22 2009	(r190930)
+++ head/sbin/newfs_msdos/newfs_msdos.c	Sat Apr 11 14:53:32 2009	(r190931)
@@ -367,10 +367,15 @@ main(int argc, char *argv[])
 	err(1, "%s", fname);
     if (fstat(fd, &sb))
 	err(1, "%s", fname);
+    if (opt_create) {
+	if (!S_ISREG(sb.st_mode))
+	    warnx("warning, %s is not a regular file", fname);
+    } else {
+	if (!S_ISCHR(sb.st_mode))
+	    warnx("warning, %s is not a character device", fname);
+    }
     if (!opt_N)
 	check_mounted(fname, sb.st_mode);
-    if (!S_ISCHR(sb.st_mode))
-	warnx("warning, %s is not a character device", fname);
     if (opt_ofs && opt_ofs != lseek(fd, opt_ofs, SEEK_SET))
 	errx(1, "cannot seek to %jd", (intmax_t)opt_ofs);
     memset(&bpb, 0, sizeof(bpb));



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