From swear@blarg.net  Sat Mar 30 23:37:49 2002
Return-Path: <swear@blarg.net>
Received: from lists.blarg.net (lists.blarg.net [206.124.128.17])
	by hub.freebsd.org (Postfix) with ESMTP id 9355137B419
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 30 Mar 2002 23:37:48 -0800 (PST)
Received: from thig.blarg.net (thig.blarg.net [206.124.128.18])
	by lists.blarg.net (Postfix) with ESMTP id 52C62BD14
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 30 Mar 2002 23:37:48 -0800 (PST)
Received: from localhost.localdomain ([206.124.139.115])
	by thig.blarg.net (8.9.3/8.9.3) with ESMTP id XAA10810
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 30 Mar 2002 23:37:48 -0800
Received: (from jojo@localhost)
	by localhost.localdomain (8.11.6/8.11.3) id g2V7a7n42910;
	Sat, 30 Mar 2002 23:36:07 -0800 (PST)
	(envelope-from swear@blarg.net)
Message-Id: <ix4rixb34o.rix@localhost.localdomain>
Date: 30 Mar 2002 23:36:07 -0800
From: "Gary W. Swearingen" <swear@blarg.net>
Reply-To: swear@blarg.net
To: FreeBSD-gnats-submit@freebsd.org
Subject: fdisk(8) program has misplaced NOT_NOW block in write_s0.
X-GNATS-Notify:

>Number:         36564
>Category:       bin
>Synopsis:       fdisk(8) program has misplaced NOT_NOW block in write_s0.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Mar 30 23:40:01 PST 2002
>Closed-Date:    Sun Dec 08 13:13:44 PST 2002
>Last-Modified:  Sun Dec 08 13:13:44 PST 2002
>Originator:     Gary W. Swearingen
>Release:        FreeBSD 4.5-STABLE i386
>Organization:
none
>Environment:
n/a
================
>Description:

The fdisk(8) program has a "ifdef NOT_NOW" block in write_s0 which
is placed immediately after a "return -1;" statement (while another
one is before "return(0)").  It seems highly likely that the block
should be moved before the return statement, but I must admit that I
have no idea how "NOT_NOW" is used.  I'm assuming that the block's
code is not now compiled; hence the low priority on the PR.
================
>How-To-Repeat:
n/a
================
>Fix:
From
"$FreeBSD: src/sbin/i386/fdisk/fdisk.c,v 1.36.2.10 2002/01/02 23:12:41 iedowse Exp $"

--- /usr/src/sbin/i386/fdisk/fdisk.c    Sat Mar  2 15:58:41 2002
+++ /tmp/fdisk.c        Sat Mar 30 23:31:00 2002
@@ -826,11 +826,11 @@
                if (write_disk(sector,
                               &mboot.bootinst[sector * secsize]) == -1) {
                        warn("can't write fdisk partition table");
-                       return -1;
 #ifdef NOT_NOW
                        flag = 0;
                        (void) ioctl(fd, DIOCWLABEL, &flag);
 #endif
+                       return -1;
                }
 #ifdef NOT_NOW
        flag = 0;
>Release-Note:
>Audit-Trail:

From: Poul-Henning Kamp <phk@critter.freebsd.dk>
To: swear@blarg.net
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: bin/36564: fdisk(8) program has misplaced NOT_NOW block in write_s0. 
Date: Sun, 31 Mar 2002 09:47:24 +0200

 In message <ix4rixb34o.rix@localhost.localdomain>, "Gary W. Swearingen" writes:
 
 This was recently fixed in -current.
 
 -- 
 Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
 phk@FreeBSD.ORG         | TCP/IP since RFC 956
 FreeBSD committer       | BSD since 4.3-tahoe    
 Never attribute to malice what can adequately be explained by incompetence.
State-Changed-From-To: open->closed 
State-Changed-By: iedowse 
State-Changed-When: Sun Dec 8 13:08:30 PST 2002 
State-Changed-Why:  

This has been fixed in -CURRENT, and since it relates to a block 
of code that is #if'd out and clearly not meant to be compiled, 
there isn't much point in merging the change into -STABLE. 

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