]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/commit
MFC r243907:
authordim <dim@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Wed, 19 Dec 2012 12:19:56 +0000 (12:19 +0000)
committerdim <dim@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Wed, 19 Dec 2012 12:19:56 +0000 (12:19 +0000)
commitf21078acdaa39ea75c9fe4549a6d37486d6d35f7
tree0eb9dceba0eda216f1c41abacdc9932b5c592ad7
parentf72ef3c0c35328f7dd20ecf9ce99464b88e8dc62
MFC r243907:

Fix an old bug in devd, where it uses std::sort() to sort the various
lists it reads from its configuration files on the priority field.

Because some items in the lists have the same priority, and std::sort()
is not stable, the exact order in which the items are enumerated does
not have to correspond to the order they appear in the configuration
files.

Apparently this was never noticed with libstdc++, but with libc++ it
could cause the "uhid" entry from /etc/devd/usb.conf to be used instead
of the "ums" entry (which is earlier in the file).  This caused the
problem described in the PR: the USB mouse module was never loaded, and
the other actions (such as starting moused) were not executed.

To fix the problem, make devd use std:stable_sort() instead.

Reported by: Jan Beich <jbeich@tormail.org>
PR: bin/172958

git-svn-id: svn://svn.freebsd.org/base/stable/8@244431 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sbin/devd/devd.cc