Module Name: src Committed By: martin Date: Fri Aug 23 17:21:05 UTC 2024
Modified Files: src/usr.bin/config [netbsd-9]: defs.h files.c mkioconf.c mkmakefile.c pack.c Log Message: Pull up following revision(s) (requested by riastradh in ticket #1875): 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.104.2.2 -r1.104.2.3 src/usr.bin/config/defs.h cvs rdiff -u -r1.36.16.1 -r1.36.16.2 src/usr.bin/config/files.c cvs rdiff -u -r1.35 -r1.35.6.1 src/usr.bin/config/mkioconf.c cvs rdiff -u -r1.71 -r1.71.2.1 src/usr.bin/config/mkmakefile.c cvs rdiff -u -r1.10 -r1.10.18.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.