summaryrefslogtreecommitdiff
path: root/udevdb.c
diff options
context:
space:
mode:
authorgreg@kroah.com <greg@kroah.com>2003-10-15 23:50:13 -0700
committerGreg KH <gregkh@suse.de>2005-04-26 21:01:40 -0700
commit6739707df53097ac378f8ff2f0aa694257e31da1 (patch)
tree841262fe4d59cc4200e8c8cb3dc7d100ea3cec8a /udevdb.c
parentc27e69116d3ef0ea069a3c5146009ced08a0238b (diff)
[PATCH] put config files and database in /etc/udev by default
Can be overridden on the makefile line.
Diffstat (limited to 'udevdb.c')
-rw-r--r--udevdb.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/udevdb.c b/udevdb.c
index c2e90be32f..db5bb73de9 100644
--- a/udevdb.c
+++ b/udevdb.c
@@ -9,6 +9,9 @@
#include <errno.h>
#include <signal.h>
+#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;
}