+/*
+ * udevdb.c
+ *
+ * Userspace devfs
+ *
+ * Copyright (C) 2003 Greg Kroah-Hartman <greg@kroah.com>
+ * Copyright (C) 2003 IBM Corp.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
/*
* udev database library
*/
#include <errno.h>
#include <signal.h>
+#include "udev_version.h"
+#include "udev.h"
+#include "namedev.h"
#include "udevdb.h"
#include "tdb/tdb.h"
*/
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;
}