bin/90310: code cleanup for config(8)
Matt Emmerton
matt at gsicomp.on.ca
Mon Dec 12 15:00:13 PST 2005
>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:
More information about the freebsd-bugs
mailing list