svn commit: r244431 - stable/8/sbin/devd

Dimitry Andric dim at
Wed Dec 19 12:19:57 UTC 2012

Author: dim
Date: Wed Dec 19 12:19:56 2012
New Revision: 244431

  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
  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 at>
  PR:		bin/172958

Directory Properties:
  stable/8/sbin/devd/   (props changed)

Modified: stable/8/sbin/devd/
--- stable/8/sbin/devd/	Wed Dec 19 12:19:45 2012	(r244430)
+++ stable/8/sbin/devd/	Wed Dec 19 12:19:56 2012	(r244431)
@@ -352,7 +352,7 @@ public:
 config::sort_vector(vector<event_proc *> &v)
-	sort(v.begin(), v.end(), epv_greater());
+	stable_sort(v.begin(), v.end(), epv_greater());

More information about the svn-src-stable-8 mailing list