chiark / gitweb /
[PATCH] fix dbg line in namedev.c
[elogind.git] / udev-add.c
index 7906638a7f066670fbd2bea6d5a603d523fdb309..7d0bdadcb75fe3821bdfe1dff57f6a7fce6027db 100644 (file)
@@ -34,8 +34,6 @@
 #include "udevdb.h"
 #include "libsysfs/libsysfs.h"
 
-static char sysfs_path[SYSFS_PATH_MAX];
-
 /* 
  * Right now the major/minor of a device is stored in a file called
  * "dev" in sysfs.
@@ -75,7 +73,7 @@ static int create_node(struct udevice *dev)
        char filename[255];
        int retval = 0;
 
-       strncpy(filename, UDEV_ROOT, sizeof(filename));
+       strncpy(filename, udev_root, sizeof(filename));
        strncat(filename, dev->name, sizeof(filename));
 
        switch (dev->type) {
@@ -130,7 +128,7 @@ exit:
  * If it doesn't happen in about 10 seconds, give up.
  */
 #define SECONDS_TO_WAIT_FOR_DEV                10
-int sleep_for_dev(char *path)
+static int sleep_for_dev(char *path)
 {
        char filename[SYSFS_PATH_MAX + 6];
        struct stat buf;
@@ -152,6 +150,7 @@ int sleep_for_dev(char *path)
                /* sleep for a second or two to give the kernel a chance to
                 * create the dev file */
                sleep(1);
+               ++loop;
        }
        retval = -ENODEV;
 exit:
@@ -171,13 +170,6 @@ int udev_add_device(char *path, char *subsystem)
        else
                dev.type = 'c';
 
-       retval = sysfs_get_mnt_path(sysfs_path, SYSFS_PATH_MAX);
-       dbg("sysfs_path = %s", sysfs_path);
-       if (retval) {
-               dbg("sysfs_get_mnt_path failed");
-               goto exit;
-       }
-
        retval = sleep_for_dev(path);
        if (retval)
                goto exit;