chiark / gitweb /
[PATCH] Create a udev.rules.examples file to hold odd udev.rules
[elogind.git] / namedev.c
index 186a9f5cc25fdec1afa5bb4d51d71c495300d55d..89513934ff4e483a49d60f621c973ddfd77d49f0 100644 (file)
--- a/namedev.c
+++ b/namedev.c
 #include <time.h>
 #include <sys/wait.h>
 #include <sys/stat.h>
+#include <sysfs/libsysfs.h>
 
 #include "list.h"
 #include "udev.h"
 #include "udev_version.h"
 #include "logging.h"
 #include "namedev.h"
-#include "libsysfs/libsysfs.h"
 #include "klibc_fixups.h"
 
 static struct sysfs_attribute *find_sysfs_attribute(struct sysfs_class_device *class_dev, struct sysfs_device *sysfs_device, char *attr);
@@ -623,7 +623,8 @@ static struct sysfs_device *get_sysfs_device(struct sysfs_class_device *class_de
        tspec.tv_nsec = 10000000;  /* sleep 10 millisec */
        loop = 10;
        while (loop--) {
-               nanosleep(&tspec, NULL);
+               if (udev_sleep)
+                       nanosleep(&tspec, NULL);
                if (class_dev_parent)
                        sysfs_device = sysfs_get_classdev_device(class_dev_parent);
                else
@@ -650,7 +651,8 @@ device_found:
                loop = 10;
                tspec.tv_nsec = 10000000;
                while (loop--) {
-                       nanosleep(&tspec, NULL);
+                       if (udev_sleep)
+                               nanosleep(&tspec, NULL);
                        sysfs_get_device_bus(sysfs_device);
                        
                        if (sysfs_device->bus[0] != '\0')