Date: Mon, 17 Nov 2025 14:46:54 GMT From: Ed Maste <emaste@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: cf3e1dc5f59e - stable/15 - newfs_msdos: Improve error messages Message-ID: <202511171446.5AHEksQL099236@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch stable/15 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=cf3e1dc5f59e13252ef314bd4f72e19c38115840 commit cf3e1dc5f59e13252ef314bd4f72e19c38115840 Author: Ed Maste <emaste@FreeBSD.org> AuthorDate: 2025-11-09 19:43:50 +0000 Commit: Ed Maste <emaste@FreeBSD.org> CommitDate: 2025-11-17 14:46:37 +0000 newfs_msdos: Improve error messages - Report overly long OEM string as too long, not just "bad". - Use warn instead of warnx for open or ftruncate failure to report the error string. Reviewed by: se Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D53649 (cherry picked from commit dbb34d496708a37763d3d8bf6782991dee10d17e) --- sbin/newfs_msdos/mkfs_msdos.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sbin/newfs_msdos/mkfs_msdos.c b/sbin/newfs_msdos/mkfs_msdos.c index dcc2bb982efc..a570d92cd17b 100644 --- a/sbin/newfs_msdos/mkfs_msdos.c +++ b/sbin/newfs_msdos/mkfs_msdos.c @@ -264,7 +264,7 @@ mkfs_msdos(const char *fname, const char *dtype, const struct msdos_options *op) goto done; } if (o.OEM_string && strlen(o.OEM_string) > 8) { - warnx("%s: bad OEM string", o.OEM_string); + warnx("%s: OEM string too long", o.OEM_string); goto done; } if (o.create_size) { @@ -274,11 +274,11 @@ mkfs_msdos(const char *fname, const char *dtype, const struct msdos_options *op) } fd = open(fname, O_RDWR | O_CREAT | O_TRUNC, 0644); if (fd == -1) { - warnx("failed to create %s", fname); + warn("failed to create %s", fname); goto done; } if (ftruncate(fd, o.create_size)) { - warnx("failed to initialize %jd bytes", (intmax_t)o.create_size); + warn("failed to initialize %jd bytes", (intmax_t)o.create_size); goto done; } } else if ((fd = open(fname, o.no_create ? O_RDONLY : O_RDWR)) == -1) {help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202511171446.5AHEksQL099236>
