chiark / gitweb /
[PATCH] move the config files to etc/udev to clean up main directory a bit.
[elogind.git] / udevdb.c
index bbbeddad477958a6cb9827879d82cf1675ae28b5..ca9e63c97e61d4376f0d9593b2c54b3a4b936bcf 100644 (file)
--- a/udevdb.c
+++ b/udevdb.c
@@ -128,3 +128,16 @@ int udevdb_init(int init_flag)
        }
        return 0;
 }
+
+/**
+ * udevdb_open_ro: open database for reading
+ */
+int udevdb_open_ro(void)
+{
+       udevdb = tdb_open(udev_db_filename, 0, 0, O_RDONLY, 0);
+       if (udevdb == NULL) {
+               dbg("unable to open database at '%s'", udev_db_filename);
+               return -EINVAL;
+       }
+       return 0;
+}