NetBSD Problem Report #50886

From www@NetBSD.org  Wed Mar  2 19:41:05 2016
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 924507A217
	for <gnats-bugs@gnats.NetBSD.org>; Wed,  2 Mar 2016 19:41:05 +0000 (UTC)
Message-Id: <20160302194104.76B3A7ABFC@mollari.NetBSD.org>
Date: Wed,  2 Mar 2016 19:41:04 +0000 (UTC)
From: dcb314@hotmail.com
Reply-To: dcb314@hotmail.com
To: gnats-bugs@NetBSD.org
Subject: src/usr.sbin/sysinst/partman.c:472: some confused coding ?
X-Send-Pr-Version: www-1.0

>Number:         50886
>Category:       bin
>Synopsis:       src/usr.sbin/sysinst/partman.c:472: some confused coding ?
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 02 19:45:00 +0000 2016
>Closed-Date:    Mon May 30 17:22:50 +0000 2016
>Last-Modified:  Mon May 30 17:22:50 +0000 2016
>Originator:     David Binderman
>Release:        cvs dated 20160302
>Organization:
>Environment:
>Description:
src/usr.sbin/sysinst/partman.c:472]: (style) Statements following return, break, continue, goto or throw will never be executed.

Source code is

        case PMR_MENU_NUMROW:
            process_menu(MENU_ok, deconst(MSG_raid_nomultidim));
            return 0;
            msg_to_show = MSG_raid_numrow_ask;
            out_var = &(dev_ptr->numRow);
            break;

This looks like a cut'n'paste error to me.
Suggest code rework.

Also, I found this:

[src/usr.sbin/sysinst/partman.c:1806]: (style) Variable 'hackerr' is assigned a value that is never used.

Source code is

    for (i = 0; i < num; i ++)
        if (! wedges[i].allocated && wedges[i].todel) {
            hackerr = run_program(RUN_SILENT | RUN_ERROR_OK,
                "dkctl %s delwedge dk%d", wedges[num].pm->diskdev, i);
            wedges[i].todel = 0;
        }

This might also benefit from some rework.

>How-To-Repeat:

>Fix:

>Release-Note:

>Audit-Trail:
From: "David A. Holland" <dholland@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/50886 CVS commit: src/usr.sbin/sysinst
Date: Mon, 30 May 2016 17:00:39 +0000

 Module Name:	src
 Committed By:	dholland
 Date:		Mon May 30 17:00:38 UTC 2016

 Modified Files:
 	src/usr.sbin/sysinst: partman.c

 Log Message:
 #if out some unreachable code that's apparently not yet supported.
 PR 50886 from David Binderman.


 To generate a diff of this commit:
 cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/sysinst/partman.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "David A. Holland" <dholland@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/50886 CVS commit: src/usr.sbin/sysinst
Date: Mon, 30 May 2016 17:03:21 +0000

 Module Name:	src
 Committed By:	dholland
 Date:		Mon May 30 17:03:21 UTC 2016

 Modified Files:
 	src/usr.sbin/sysinst: partman.c

 Log Message:
 Explicitly ignore errors in the hack for mucking with wedges; mark it XXX
 for future attention. Other part of PR 50886 from David Binderman.


 To generate a diff of this commit:
 cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/sysinst/partman.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Mon, 30 May 2016 17:22:50 +0000
State-Changed-Why:
fixed (more or less), thanks


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.