X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=udev_rules.c;h=492a9b0dfc89e81bd6333d65a142256ca5cdabae;hb=731a7d6d75fa412d676fd536ea282f33296f64cb;hp=7c733568312e512a2d95f5cb65c4babbe7a7664f;hpb=2983db9745f8c2ebd54f8be4a6314733ae227e16;p=elogind.git diff --git a/udev_rules.c b/udev_rules.c index 7c7335683..492a9b0df 100644 --- a/udev_rules.c +++ b/udev_rules.c @@ -39,7 +39,6 @@ #include "udev_version.h" #include "logging.h" #include "udev_rules.h" -#include "udev_db.h" /* extract possible {attr} and move str behind it */ @@ -208,7 +207,7 @@ static int import_file_into_env(struct udevice *udev, const char *filename) size_t bufsize; if (file_map(filename, &buf, &bufsize) != 0) { - err("can't open '%s'", filename); + err("can't open '%s': %s", filename, strerror(errno)); return -1; } import_keys_into_env(udev, buf, bufsize); @@ -376,7 +375,7 @@ attr_found: return 0; } -#define WAIT_LOOP_PER_SECOND 20 +#define WAIT_LOOP_PER_SECOND 50 static int wait_for_sysfs(struct udevice *udev, const char *file, int timeout) { char filename[PATH_SIZE]; @@ -392,9 +391,10 @@ static int wait_for_sysfs(struct udevice *udev, const char *file, int timeout) info("file appeared after %i loops", (timeout * WAIT_LOOP_PER_SECOND) - loop-1); return 0; } + info("wait for %i mseconds", 1000 / WAIT_LOOP_PER_SECOND); usleep(1000 * 1000 / WAIT_LOOP_PER_SECOND); } - info("waiting for '%s' failed", filename); + err("waiting for '%s' failed", filename); return -1; } @@ -648,7 +648,7 @@ found: } pos = getenv(attr); if (pos == NULL) { - dbg("env '%s' not avialable", attr); + dbg("env '%s' not available", attr); break; } dbg("substitute env '%s=%s'", attr, pos);