mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
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
This commit is contained in:
parent
c723af1169
commit
d9aee13f6f
1 changed files with 2 additions and 0 deletions
|
|
@ -285,8 +285,10 @@ mkfs_msdos(const char *fname, const char *dtype, const struct msdos_options *op)
|
|||
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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue