]> rtime.felk.cvut.cz Git - l4.git/blobdiff - l4/pkg/io/server/src/hw_device.cc
update
[l4.git] / l4 / pkg / io / server / src / hw_device.cc
index 52642bf1cb50d7c818b1a8c9d882fa8dca2f4dd6..6cd8d85f94358c4ff6c1bb9dec0aaef58d007ec0 100644 (file)
@@ -6,6 +6,10 @@
  * GNU General Public License 2.
  * Please see the COPYING-GPL-2 file for details.
  */
+
+#include <libc-symbols.h>
+#include <fnmatch.h>
+
 #include "hw_device.h"
 #include "cfg.h"
 
@@ -166,8 +170,13 @@ Device::set_property(cxx::String const &prop, Prop_val const &val)
 bool
 Device::match_cid(cxx::String const &cid) const
 {
-  if (cid == hid())
-    return true;
+    {
+      char cid_cstr[cid.len() + 1];
+      __builtin_memcpy(cid_cstr, cid.start(), cid.len());
+      cid_cstr[cid.len()]  = 0;
+      if (!fnmatch(cid_cstr, hid(), 0))
+        return true;
+    }
 
   for (Cid_list::const_iterator i = _cid.begin(); i != _cid.end(); ++i)
     if (cid == (*i).c_str())