aboutsummaryrefslogtreecommitdiffstats
path: root/udev.c
diff options
context:
space:
mode:
authordsteklof@us.ibm.com <dsteklof@us.ibm.com>2003-10-14 23:20:53 -0700
committerGreg KH <gregkh@suse.de>2005-04-26 21:01:40 -0700
commitdbfc520c605dee3244dbbfd563e908901324689b (patch)
treec9952c04fb643a912c4aef4bef9201fff0727f6f /udev.c
parent149f210617e812922831e329c347095115585783 (diff)
downloadudev-dbfc520c605dee3244dbbfd563e908901324689b.tar.gz
[PATCH] udevdb patch
This patch: 1) removes the three database files for just one udevdb.tdb file. 2) adds udevdb_init() and udevdb_exit() functions 3) initializes database now in main() in udev.c. Please look it over.
Diffstat (limited to 'udev.c')
-rw-r--r--udev.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/udev.c b/udev.c
index 74572625..6e7ac251 100644
--- a/udev.c
+++ b/udev.c
@@ -31,6 +31,7 @@
#include "udev.h"
#include "udev_version.h"
#include "namedev.h"
+#include "udevdb.h"
#include "libsysfs/libsysfs.h"
@@ -91,17 +92,27 @@ int main(int argc, char *argv[])
goto exit;
}
+ /* initialize udev database */
+ retval = udevdb_init(UDEVDB_DEFAULT);
+ if (retval != 0) {
+ dbg("Unable to initialize database.");
+ goto exit;
+ }
+
/* initialize the naming deamon */
namedev_init();
if (strcmp(action, "add") == 0)
- return udev_add_device(device, argv[1]);
+ retval = udev_add_device(device, argv[1]);
- if (strcmp(action, "remove") == 0)
- return udev_remove_device(device, argv[1]);
+ else if (strcmp(action, "remove") == 0)
+ retval = udev_remove_device(device, argv[1]);
- dbg("Unknown action: %s", action);
- retval = -EINVAL;
+ else {
+ dbg("Unknown action: %s", action);
+ retval = -EINVAL;
+ }
+ udevdb_exit();
exit:
return retval;