chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
df97701
)
sysfs: change order of subsystem lookup
author
Kay Sievers
<kay.sievers@vrfy.org>
Sat, 2 Jun 2007 20:00:10 +0000
(22:00 +0200)
committer
Kay Sievers
<kay.sievers@vrfy.org>
Sat, 2 Jun 2007 20:00:10 +0000
(22:00 +0200)
udev_sysfs.c
patch
|
blob
|
history
diff --git
a/udev_sysfs.c
b/udev_sysfs.c
index 8525620a095ca79ec0337bb72088f28bc35fc21d..98be9a5352e9f7807ce6c4c72a24d925389f04ff 100644
(file)
--- a/
udev_sysfs.c
+++ b/
udev_sysfs.c
@@
-446,16
+446,16
@@
int sysfs_lookup_devpath_by_subsys_id(char *devpath_full, size_t len, const char
if (stat(path_full, &statbuf) == 0)
goto found;
if (stat(path_full, &statbuf) == 0)
goto found;
- strlcpy(path, "/
clas
s/", sizeof(path_full) - sysfs_len);
+ strlcpy(path, "/
bu
s/", sizeof(path_full) - sysfs_len);
strlcat(path, id, sizeof(path_full) - sysfs_len);
if (stat(path_full, &statbuf) == 0)
goto found;
strlcat(path, id, sizeof(path_full) - sysfs_len);
if (stat(path_full, &statbuf) == 0)
goto found;
+ goto out;
- strlcpy(path, "/
bu
s/", sizeof(path_full) - sysfs_len);
+ strlcpy(path, "/
clas
s/", sizeof(path_full) - sysfs_len);
strlcat(path, id, sizeof(path_full) - sysfs_len);
if (stat(path_full, &statbuf) == 0)
goto found;
strlcat(path, id, sizeof(path_full) - sysfs_len);
if (stat(path_full, &statbuf) == 0)
goto found;
- goto out;
}
if (strcmp(subsystem, "module") == 0) {
}
if (strcmp(subsystem, "module") == 0) {
@@
-499,22
+499,21
@@
int sysfs_lookup_devpath_by_subsys_id(char *devpath_full, size_t len, const char
if (stat(path_full, &statbuf) == 0)
goto found;
if (stat(path_full, &statbuf) == 0)
goto found;
- strlcpy(path, "/
clas
s/", sizeof(path_full) - sysfs_len);
+ strlcpy(path, "/
bu
s/", sizeof(path_full) - sysfs_len);
strlcat(path, subsystem, sizeof(path_full) - sysfs_len);
strlcat(path, subsystem, sizeof(path_full) - sysfs_len);
- strlcat(path, "/", sizeof(path_full) - sysfs_len);
+ strlcat(path, "/
devices/
", sizeof(path_full) - sysfs_len);
strlcat(path, id, sizeof(path_full) - sysfs_len);
if (stat(path_full, &statbuf) == 0)
goto found;
strlcat(path, id, sizeof(path_full) - sysfs_len);
if (stat(path_full, &statbuf) == 0)
goto found;
- strlcpy(path, "/
bu
s/", sizeof(path_full) - sysfs_len);
+ strlcpy(path, "/
clas
s/", sizeof(path_full) - sysfs_len);
strlcat(path, subsystem, sizeof(path_full) - sysfs_len);
strlcat(path, subsystem, sizeof(path_full) - sysfs_len);
- strlcat(path, "/
devices/
", sizeof(path_full) - sysfs_len);
+ strlcat(path, "/", sizeof(path_full) - sysfs_len);
strlcat(path, id, sizeof(path_full) - sysfs_len);
if (stat(path_full, &statbuf) == 0)
goto found;
out:
return 0;
strlcat(path, id, sizeof(path_full) - sysfs_len);
if (stat(path_full, &statbuf) == 0)
goto found;
out:
return 0;
-
found:
if (S_ISLNK(statbuf.st_mode))
sysfs_resolve_link(path, sizeof(path_full) - sysfs_len);
found:
if (S_ISLNK(statbuf.st_mode))
sysfs_resolve_link(path, sizeof(path_full) - sysfs_len);