X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=udevdb.c;h=db5bb73de9a18d9dc937dac9d59c26d5a6865f08;hp=c2e90be32f47a71eceddc820c041e17c734ff4b6;hb=bf3ca56fd4685a52ae66ed6ee05ec4705130b9fe;hpb=dbfc520c605dee3244dbbfd563e908901324689b diff --git a/udevdb.c b/udevdb.c index c2e90be32..db5bb73de 100644 --- a/udevdb.c +++ b/udevdb.c @@ -9,6 +9,9 @@ #include #include +#include "udev_version.h" +#include "udev.h" +#include "namedev.h" #include "udevdb.h" #include "tdb/tdb.h" @@ -63,9 +66,14 @@ static void udevdb_close(void) */ static int udevdb_open(int method) { - udevdb = tdb_open(UDEVDB, 0, method, O_RDWR | O_CREAT, 0644); - if (udevdb == NULL) - return -1; + udevdb = tdb_open(UDEV_CONFIG_DIR UDEV_DB, 0, method, O_RDWR | O_CREAT, 0644); + if (udevdb == NULL) { + if (method == UDEVDB_INTERNAL) + dbg("Unable to initialize in-memory database"); + else + dbg("Unable to initialize database at %s", UDEV_CONFIG_DIR UDEV_DB); + return -EINVAL; + } return 0; }