X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=udev-add.c;h=8c63214a46794ebb233ed1e8cffc8c8875865697;hb=1c386a909af69bc5b53eb03fedead725f5fc8331;hp=d9d7cab103098a35b14d95f384ade479399cb269;hpb=c056c5141b16fe95485eeb233fe8b90954686a60;p=elogind.git diff --git a/udev-add.c b/udev-add.c index d9d7cab10..8c63214a4 100644 --- a/udev-add.c +++ b/udev-add.c @@ -27,6 +27,7 @@ #include #include #include +#include #include "udev.h" #include "udev_version.h" @@ -128,7 +129,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; @@ -150,6 +151,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: @@ -160,7 +162,6 @@ int udev_add_device(char *path, char *subsystem) { struct sysfs_class_device *class_dev; struct udevice dev; - struct device_attr attr; int retval = -EINVAL; /* for now, the block layer is the only place where block devices are */ @@ -177,7 +178,7 @@ int udev_add_device(char *path, char *subsystem) if (class_dev == NULL) goto exit; - retval = namedev_name_device(class_dev, &attr); + retval = namedev_name_device(class_dev, &dev); if (retval) return retval; @@ -187,10 +188,10 @@ int udev_add_device(char *path, char *subsystem) goto exit; } - strcpy(dev.name, attr.name); - strcpy(dev.owner, attr.owner); - strcpy(dev.group, attr.group); - dev.mode = attr.mode; +// strcpy(dev.name, attr.name); +// strcpy(dev.owner, attr.owner); +// strcpy(dev.group, attr.group); +// dev.mode = attr.mode; retval = udevdb_add_dev(path, &dev); if (retval != 0)