Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: [netbsd-10] src/usr.bin/config



Module Name:    src
Committed By:   martin
Date:           Fri Aug 23 17:19:19 UTC 2024

Modified Files:
        src/usr.bin/config [netbsd-10]: defs.h files.c mkioconf.c mkmakefile.c
            pack.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #798):

        usr.bin/config/defs.h: revision 1.109
        usr.bin/config/files.c: revision 1.38
        usr.bin/config/mkmakefile.c: revision 1.73
        usr.bin/config/pack.c: revision 1.11
        usr.bin/config/mkioconf.c: revision 1.36

config(1): Make sort order deterministic.

Ensure we break ties in every case.  This way, even though we use the
unstable qsort(3) library routine, the output is reproducible, no
matter what algorithm is behind qsort(3).

It would be nice if we could just use a stable sort function here,
but mergesort(3) is nonstandard, so we'd have to add it to
tools/compat, which is a big pain.

Instead, put a tie-breaking rule in every comparison function we use
with qsort, and abort() in the event of ties -- that way, we noisily
refuse to rely on unstable sort order.

While here, dispense with any question of integer overflow, and
sprinkle comments.

PR bin/58115


To generate a diff of this commit:
cvs rdiff -u -r1.106 -r1.106.6.1 src/usr.bin/config/defs.h
cvs rdiff -u -r1.37 -r1.37.6.1 src/usr.bin/config/files.c
cvs rdiff -u -r1.35 -r1.35.14.1 src/usr.bin/config/mkioconf.c
cvs rdiff -u -r1.71 -r1.71.10.1 src/usr.bin/config/mkmakefile.c
cvs rdiff -u -r1.10 -r1.10.26.1 src/usr.bin/config/pack.c

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




Home | Main Index | Thread Index | Old Index