Module Name: src
Committed By: tsutsui
Date: Wed Dec 20 15:07:16 UTC 2023
Modified Files:
src/usr.sbin/makefs: msdos.c
Log Message:
Return a proper exit status on failure on creating msdosfs.
No particular comment in PR bin/57752.
Should be pulled up to netbsd-10 and netbsd-9.
To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/usr.sbin/makefs/msdos.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.sbin/makefs/msdos.c
diff -u src/usr.sbin/makefs/msdos.c:1.21 src/usr.sbin/makefs/msdos.c:1.22
--- src/usr.sbin/makefs/msdos.c:1.21 Sat Apr 9 10:05:35 2022
+++ src/usr.sbin/makefs/msdos.c Wed Dec 20 15:07:16 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: msdos.c,v 1.21 2022/04/09 10:05:35 riastradh Exp $ */
+/* $NetBSD: msdos.c,v 1.22 2023/12/20 15:07:16 tsutsui Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: msdos.c,v 1.21 2022/04/09 10:05:35 riastradh Exp $");
+__RCSID("$NetBSD: msdos.c,v 1.22 2023/12/20 15:07:16 tsutsui Exp $");
#endif /* !__lint */
#include <sys/param.h>
@@ -177,7 +177,7 @@ msdos_makefs(const char *image, const ch
printf("Creating `%s'\n", image);
TIMER_START(start);
if (mkfs_msdos(image, NULL, &msdos_opt->options) == -1)
- return;
+ errx(1, "Image file `%s' not created.", image);
TIMER_RESULTS(start, "mkfs_msdos");
fsopts->fd = open(image, O_RDWR);
@@ -201,7 +201,7 @@ msdos_makefs(const char *image, const ch
printf("Populating `%s'\n", image);
TIMER_START(start);
if (msdos_populate_dir(dir, VTODE(&rootvp), root, root, fsopts) == -1)
- errx(1, "Image file `%s' not created.", image);
+ errx(1, "Image file `%s' not populated.", image);
TIMER_RESULTS(start, "msdos_populate_dir");
if (debug & DEBUG_FS_MAKEFS)