bin/81035: [patch] boot0cfg emits bogus error

Peter Schuller peter.schuller at infidyne.com
Sat May 14 20:00:23 GMT 2005


>Number:         81035
>Category:       bin
>Synopsis:       [patch] boot0cfg emits bogus error
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat May 14 20:00:22 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     User &
>Release:        FreeBSD 5.3-RELEASE i386
>Organization:
>Environment:
System: FreeBSD starfury.scode.org 5.3-RELEASE FreeBSD 5.3-RELEASE #1: Sun Nov 28 02:57:30 CET 2004 toor at .bredbandsbolaget.se:/usr/obj/usr/src/sys/STARFURY i386


  (problem+patch also applies to 5.4)
>Description:
  boot0cfg emits bogus error messages. Example: With /dev/da1 being busy because
  GEOM is using it, "boot0cfg -B -o packet /dev/da1" reported "No such file or directory"
  even though /dev/da1 clearly existed. In reality open() returned EACCESS, but
  boot0cfg went ahead with other stuff and printed the error-message for *THAT*.
>How-To-Repeat:
>Fix:

Report the error immediately:

--- boot0cfg.patch begins here ---
--- usr.sbin/boot0cfg/boot0cfg.c.orig	Fri Oct 15 17:59:26 2004
+++ usr.sbin/boot0cfg/boot0cfg.c	Sat May 14 21:47:40 2005
@@ -264,6 +264,8 @@
 	if (n != mbr_size)
 	   errx(1, "%s: short write", fname);
 	return;
+    } else {
+      err(1, "write_mbr: %s", fname);
     }
     if (flags != 0)
 	err(1, "%s", fname);
@@ -282,8 +284,8 @@
 	free(s);
 	return;
     }
-#endif
     err(1, "write_mbr: %s", fname);
+#endif
 }
 
 /*
--- boot0cfg.patch ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list