Bug 81035 - [patch] boot0cfg emits bogus error
Summary: [patch] boot0cfg emits bogus error
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 5.3-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-14 21:00 UTC by Peter Schuller
Modified: 2018-01-03 05:13 UTC (History)
0 users

See Also:


Attachments
boot0cfg.patch (425 bytes, patch)
2005-05-14 21:00 UTC, Peter Schuller
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Schuller 2005-05-14 21:00:22 UTC
  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*.

Fix: Report the error immediately:
Comment 1 Bruce Cran freebsd_committer 2010-03-02 23:23:26 UTC
Responsible Changed
From-To: freebsd-bugs->brucec

Take.
Comment 2 dfilter service freebsd_committer 2010-06-23 15:28:18 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"
Comment 3 Bruce Cran freebsd_committer 2010-06-23 15:33:17 UTC
State Changed
From-To: open->patched

Fixed in HEAD.
Comment 4 dfilter service freebsd_committer 2010-08-07 13:58:15 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"
Comment 5 dfilter service freebsd_committer 2010-08-07 14:02:35 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"
Comment 6 Bruce Cran freebsd_committer 2010-08-07 14:46:09 UTC
State Changed
From-To: patched->closed

Fix has been merged to stable/7 and stable/8.
Comment 7 Bruce Cran freebsd_committer 2010-12-06 11:38:33 UTC
State Changed
From-To: closed->open

The patch was backed out: upon failure write_mbr now deliberately keeps going. 


Comment 8 Bruce Cran freebsd_committer 2010-12-06 11:38:33 UTC
Responsible Changed
From-To: brucec->freebsd-bugs

Back to the pool.
Comment 9 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:00:58 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped