chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] udev build tweaks to tdb's spinlock code
[elogind.git]
/
udev-add.c
diff --git
a/udev-add.c
b/udev-add.c
index d9d7cab103098a35b14d95f384ade479399cb269..8c63214a46794ebb233ed1e8cffc8c8875865697 100644
(file)
--- a/
udev-add.c
+++ b/
udev-add.c
@@
-27,6
+27,7
@@
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
+#include <sys/stat.h>
#include "udev.h"
#include "udev_version.h"
#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
* 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;
{
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);
/* sleep for a second or two to give the kernel a chance to
* create the dev file */
sleep(1);
+ ++loop;
}
retval = -ENODEV;
exit:
}
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 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 */
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;
if (class_dev == NULL)
goto exit;
- retval = namedev_name_device(class_dev, &
attr
);
+ retval = namedev_name_device(class_dev, &
dev
);
if (retval)
return retval;
if (retval)
return retval;
@@
-187,10
+188,10
@@
int udev_add_device(char *path, char *subsystem)
goto exit;
}
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)
retval = udevdb_add_dev(path, &dev);
if (retval != 0)