#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
+#include <sys/stat.h>
#include "udev.h"
#include "udev_version.h"
* 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;
/* sleep for a second or two to give the kernel a chance to
* create the dev file */
sleep(1);
+ ++loop;
}
retval = -ENODEV;
exit:
{
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 */
if (class_dev == NULL)
goto exit;
- retval = namedev_name_device(class_dev, &attr);
+ retval = namedev_name_device(class_dev, &dev);
if (retval)
return retval;
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)