From owner-freebsd-bugs@FreeBSD.ORG Mon Dec 12 23:00:13 2005 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8EADD16A41F for ; Mon, 12 Dec 2005 23:00:13 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8273F43D69 for ; Mon, 12 Dec 2005 23:00:11 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id jBCN0BJr019294 for ; Mon, 12 Dec 2005 23:00:11 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id jBCN0B0x019293; Mon, 12 Dec 2005 23:00:11 GMT (envelope-from gnats) Resent-Date: Mon, 12 Dec 2005 23:00:11 GMT Resent-Message-Id: <200512122300.jBCN0B0x019293@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Matt Emmerton Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id ECB6416A41F for ; Mon, 12 Dec 2005 22:52:09 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1076043D69 for ; Mon, 12 Dec 2005 22:52:05 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id jBCMq0wb094503 for ; Mon, 12 Dec 2005 22:52:00 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id jBCMq00B094502; Mon, 12 Dec 2005 22:52:00 GMT (envelope-from nobody) Message-Id: <200512122252.jBCMq00B094502@www.freebsd.org> Date: Mon, 12 Dec 2005 22:52:00 GMT From: Matt Emmerton To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Cc: Subject: bin/90310: code cleanup for config(8) X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Dec 2005 23:00:13 -0000 >Number: 90310 >Category: bin >Synopsis: code cleanup for config(8) >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Mon Dec 12 23:00:10 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Matt Emmerton >Release: 6-STABLE >Organization: GSI Computer Services >Environment: >Description: Reviewing the source code for config(8) I noticed two issues: 1) Checks for required 'ident' and 'cpu' lines occur within low-level routines (read_files(), read_options(), makefile()), when they should be elsewhere. One of these checks was marked with a comment to this effect. 2) Code to generate env.c and hints.c was in the same routine used to generate the makefile. Comments in the code suggested that this was inappropriate. >How-To-Repeat: Read the code :) >Fix: 1) Remove the checks for 'ident' and 'cpu' from mkmakefile.c and mkoptions.c, and place them in main(), alongside the existing check for 'machine'. Files Changed: main.c mkoptions.c mkmakefile.c 2) Introduce new routines, makeenv() and makehints() to make env.c and hints.c, respectively. Files Changed: main.c mkmakefile.c config.h Diffs will be attached via follow-up. >Release-Note: >Audit-Trail: >Unformatted: