From scode@starfury.scode.org  Sat May 14 19:52:26 2005
Return-Path: <scode@starfury.scode.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 51C9D16A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 14 May 2005 19:52:26 +0000 (GMT)
Received: from starfury.scode.org (starfury.scode.org [194.145.249.108])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 10F2543D66
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 14 May 2005 19:52:26 +0000 (GMT)
	(envelope-from scode@starfury.scode.org)
Received: from starfury.scode.org (localhost [127.0.0.1])
	by starfury.scode.org (Postfix) with ESMTP id 1964A9A8869
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 14 May 2005 21:52:24 +0200 (CEST)
Received: (from scode@localhost)
	by starfury.scode.org (8.13.1/8.13.1/Submit) id j4EJqNfq015243;
	Sat, 14 May 2005 21:52:23 +0200 (CEST)
	(envelope-from scode)
Message-Id: <200505141952.j4EJqNfq015243@starfury.scode.org>
Date: Sat, 14 May 2005 21:52:23 +0200 (CEST)
From: Peter Schuller <peter.schuller@infidyne.com>
Reply-To: Peter Schuller <peter.schuller@infidyne.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [patch] boot0cfg emits bogus error
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>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:  Mon Dec 06 11:40:37 UTC 2010
>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@.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:
Responsible-Changed-From-To: freebsd-bugs->brucec  
Responsible-Changed-By: brucec 
Responsible-Changed-When: Tue Mar 2 23:23:26 UTC 2010 
Responsible-Changed-Why:  
Take. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=81035 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/81035: commit references a PR
Date: Wed, 23 Jun 2010 14:28:18 +0000 (UTC)

 Author: brucec
 Date: Wed Jun 23 14:28:08 2010
 New Revision: 209469
 URL: http://svn.freebsd.org/changeset/base/209469
 
 Log:
   If a device can't be opened, don't keep going but display the error
   returned from open() and quit.
   
   PR: bin/81035
   Submitted by: Peter Schuller <peter.schuller at infidyne.com>
   Approved by: rrs (mentor)
 
 Modified:
   head/usr.sbin/boot0cfg/boot0cfg.c
 
 Modified: head/usr.sbin/boot0cfg/boot0cfg.c
 ==============================================================================
 --- head/usr.sbin/boot0cfg/boot0cfg.c	Wed Jun 23 14:19:19 2010	(r209468)
 +++ head/usr.sbin/boot0cfg/boot0cfg.c	Wed Jun 23 14:28:08 2010	(r209469)
 @@ -356,6 +356,8 @@ write_mbr(const char *fname, int flags, 
  	if (n != mbr_size)
  	   errx(1, "%s: short write", fname);
  	return;
 +    } else {
 +	    err(1, "write_mbr: %s", fname);
      }
  
      /*
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->patched  
State-Changed-By: brucec 
State-Changed-When: Wed Jun 23 14:33:17 UTC 2010 
State-Changed-Why:  
Fixed in HEAD. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=81035 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/81035: commit references a PR
Date: Sat,  7 Aug 2010 12:58:15 +0000 (UTC)

 Author: brucec
 Date: Sat Aug  7 12:58:01 2010
 New Revision: 211013
 URL: http://svn.freebsd.org/changeset/base/211013
 
 Log:
   MFC r209469:
   
   If a device can't be opened, don't keep going but display the error
   returned from open() and quit.
   
   PR: bin/81035
   Submitted by: Peter Schuller <peter.schuller at infidyne.com>
   Approved by: rrs (mentor)
 
 Modified:
   stable/8/usr.sbin/boot0cfg/boot0cfg.c
 Directory Properties:
   stable/8/usr.sbin/boot0cfg/   (props changed)
 
 Modified: stable/8/usr.sbin/boot0cfg/boot0cfg.c
 ==============================================================================
 --- stable/8/usr.sbin/boot0cfg/boot0cfg.c	Sat Aug  7 12:54:12 2010	(r211012)
 +++ stable/8/usr.sbin/boot0cfg/boot0cfg.c	Sat Aug  7 12:58:01 2010	(r211013)
 @@ -356,6 +356,8 @@ write_mbr(const char *fname, int flags, 
  	if (n != mbr_size)
  	   errx(1, "%s: short write", fname);
  	return;
 +    } else {
 +	    err(1, "write_mbr: %s", fname);
      }
  
      /*
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/81035: commit references a PR
Date: Sat,  7 Aug 2010 13:02:35 +0000 (UTC)

 Author: brucec
 Date: Sat Aug  7 13:02:26 2010
 New Revision: 211014
 URL: http://svn.freebsd.org/changeset/base/211014
 
 Log:
   MFC r209469:
   
   If a device can't be opened, don't keep going but display the error
   returned from open() and quit.
   
   PR: bin/81035
   Submitted by: Peter Schuller <peter.schuller at infidyne.com>
   Approved by: rrs (mentor)
 
 Modified:
   stable/7/usr.sbin/boot0cfg/boot0cfg.c
 Directory Properties:
   stable/7/usr.sbin/boot0cfg/   (props changed)
 
 Modified: stable/7/usr.sbin/boot0cfg/boot0cfg.c
 ==============================================================================
 --- stable/7/usr.sbin/boot0cfg/boot0cfg.c	Sat Aug  7 12:58:01 2010	(r211013)
 +++ stable/7/usr.sbin/boot0cfg/boot0cfg.c	Sat Aug  7 13:02:26 2010	(r211014)
 @@ -355,6 +355,8 @@ write_mbr(const char *fname, int flags, 
  	if (n != mbr_size)
  	   errx(1, "%s: short write", fname);
  	return;
 +    } else {
 +	    err(1, "write_mbr: %s", fname);
      }
  
      if (flags != 0)
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed  
State-Changed-By: brucec 
State-Changed-When: Sat Aug 7 13:46:09 UTC 2010 
State-Changed-Why:  
Fix has been merged to stable/7 and stable/8. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=81035 
State-Changed-From-To: closed->open 
State-Changed-By: brucec 
State-Changed-When: Mon Dec 6 11:38:33 UTC 2010 
State-Changed-Why:  
The patch was backed out: upon failure write_mbr now deliberately keeps going. 


Responsible-Changed-From-To: brucec->freebsd-bugs 
Responsible-Changed-By: brucec 
Responsible-Changed-When: Mon Dec 6 11:38:33 UTC 2010 
Responsible-Changed-Why:  
Back to the pool. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=81035 
>Unformatted:
