NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/57752: makefs(8) -t msdos doesn't return EXIT_FAILUER on some errors



The following reply was made to PR bin/57752; it has been noted by GNATS.

From: Izumi Tsutsui <tsutsui%ceres.dti.ne.jp@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: tsutsui%ceres.dti.ne.jp@localhost
Subject: Re: bin/57752: makefs(8) -t msdos doesn't return EXIT_FAILUER on some
	 errors
Date: Sat, 9 Dec 2023 02:10:31 +0900

 > >Synopsis:       makefs(8) -t msdos doesn't return EXIT_FAILUER on some errors
  :
 > >Fix:
 > Replace "return;" after mkfs_msdos() in src/usr.sbin/makefs/msdos.c
 > with err(3) etc?
 
 Here is a quick patch (messages are taken from ffs.c):
 
 Index: msdos.c
 ===================================================================
 RCS file: /cvsroot/src/usr.sbin/makefs/msdos.c,v
 retrieving revision 1.21
 diff -u -p -d -r1.21 msdos.c
 --- msdos.c	9 Apr 2022 10:05:35 -0000	1.21
 +++ msdos.c	8 Dec 2023 16:30:06 -0000
 @@ -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)
 
 ---
 Izumi Tsutsui
 


Home | Main Index | Thread Index | Old Index