+ char base[PATH_SIZE];
+ DIR *dir;
+ struct dirent *dent;
+
+ strlcpy(base, udev_root, sizeof(base));
+ strlcat(base, "/" EVENT_FAILED_DIR, sizeof(base));
+
+ dir = opendir(base);
+ if (dir != NULL) {
+ for (dent = readdir(dir); dent != NULL; dent = readdir(dir)) {
+ char device[PATH_SIZE];
+ size_t start;
+
+ if (dent->d_name[0] == '.')
+ continue;
+
+ start = strlcpy(device, sysfs_path, sizeof(device));
+ if(start >= sizeof(device))
+ start = sizeof(device) - 1;
+ strlcat(device, dent->d_name, sizeof(device));
+ path_decode(&device[start]);
+ device_list_insert(device);
+ }
+ closedir(dir);
+ }
+}
+
+int udevtrigger(int argc, char *argv[], char *envp[])
+{
+ int failed = 0;
+ int option;
+ const char *action = "add";
+ static const struct option options[] = {
+ { "verbose", 0, NULL, 'v' },
+ { "dry-run", 0, NULL, 'n' },
+ { "retry-failed", 0, NULL, 'F' },
+ { "help", 0, NULL, 'h' },
+ { "action", 1, NULL, 'c' },
+ { "subsystem-match", 1, NULL, 's' },
+ { "subsystem-nomatch", 1, NULL, 'S' },
+ { "attr-match", 1, NULL, 'a' },
+ { "attr-nomatch", 1, NULL, 'A' },
+ {}
+ };