diff options
author | dim <dim@FreeBSD.org> | 2012-12-05 20:50:40 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2012-12-05 20:50:40 +0000 |
commit | ab2b1f57e9cea68bf7483479d6e2e84fe7886d5f (patch) | |
tree | b66688688a727452a8dcb32e67a5a12ce381255c /sbin/devd | |
parent | 3b0b9fa5f9dce3324c28e6b0b1afb52c1702a562 (diff) | |
download | FreeBSD-src-ab2b1f57e9cea68bf7483479d6e2e84fe7886d5f.zip FreeBSD-src-ab2b1f57e9cea68bf7483479d6e2e84fe7886d5f.tar.gz |
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
MFC after: 2 weeks
Diffstat (limited to 'sbin/devd')
-rw-r--r-- | sbin/devd/devd.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sbin/devd/devd.cc b/sbin/devd/devd.cc index 7724719..fa75c3f 100644 --- a/sbin/devd/devd.cc +++ b/sbin/devd/devd.cc @@ -445,7 +445,7 @@ public: void config::sort_vector(vector<event_proc *> &v) { - sort(v.begin(), v.end(), epv_greater()); + stable_sort(v.begin(), v.end(), epv_greater()); } void |