bin/90310: code cleanup for config(8)
matt at gsicomp.on.ca
Mon Dec 12 15:00:13 PST 2005
>Synopsis: code cleanup for config(8)
>Arrival-Date: Mon Dec 12 23:00:10 GMT 2005
>Originator: Matt Emmerton
GSI Computer Services
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.
Read the code :)
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'.
2) Introduce new routines, makeenv() and makehints() to make env.c and hints.c, respectively.
Diffs will be attached via follow-up.
More information about the freebsd-bugs