bufpos = snprintf(buf, sizeof(buf)-1, "%s@%s", action, devpath);
bufpos++;
bufpos = snprintf(buf, sizeof(buf)-1, "%s@%s", action, devpath);
bufpos++;
/* add standard keys */
bufpos += snprintf(&buf[bufpos], sizeof(buf)-1, "DEVPATH=%s", devpath);
bufpos++;
/* add standard keys */
bufpos += snprintf(&buf[bufpos], sizeof(buf)-1, "DEVPATH=%s", devpath);
bufpos++;
else
trigger_uevent(loop_device->name, action);
list_del(&loop_device->node);
else
trigger_uevent(loop_device->name, action);
list_del(&loop_device->node);
/* trigger remaining delayed devices */
list_for_each_entry_safe(loop_device, tmp_device, &device_list, node) {
if (sock >= 0)
/* trigger remaining delayed devices */
list_for_each_entry_safe(loop_device, tmp_device, &device_list, node) {
if (sock >= 0)
else
trigger_uevent(loop_device->name, action);
list_del(&loop_device->node);
else
trigger_uevent(loop_device->name, action);
list_del(&loop_device->node);
static const struct option options[] = {
{ "verbose", 0, NULL, 'v' },
{ "dry-run", 0, NULL, 'n' },
static const struct option options[] = {
{ "verbose", 0, NULL, 'v' },
{ "dry-run", 0, NULL, 'n' },
{ "subsystem-nomatch", 1, NULL, 'S' },
{ "attr-match", 1, NULL, 'a' },
{ "attr-nomatch", 1, NULL, 'A' },
{ "subsystem-nomatch", 1, NULL, 'S' },
{ "attr-match", 1, NULL, 'a' },
{ "attr-nomatch", 1, NULL, 'A' },
- option = getopt_long(argc, argv, "vnFo:hc:s:S:a:A:", options, NULL);
+ option = getopt_long(argc, argv, "vnFo:hce::s:S:a:A:", options, NULL);
" --dry-run do not actually trigger the events\n"
" --retry-failed trigger only the events which have been\n"
" marked as failed during a previous run\n"
" --dry-run do not actually trigger the events\n"
" --retry-failed trigger only the events which have been\n"
" marked as failed during a previous run\n"
" --subsystem-match=<subsystem> trigger devices from a matching subystem\n"
" --subsystem-nomatch=<subsystem> exclude devices from a matching subystem\n"
" --attr-match=<file[=<value>]> trigger devices with a matching sysfs\n"
" --subsystem-match=<subsystem> trigger devices from a matching subystem\n"
" --subsystem-nomatch=<subsystem> exclude devices from a matching subystem\n"
" --attr-match=<file[=<value>]> trigger devices with a matching sysfs\n"
strlcpy(&saddr.sun_path[1], sockpath, sizeof(saddr.sun_path)-1);
saddrlen = offsetof(struct sockaddr_un, sun_path) + 1 + strlen(&saddr.sun_path[1]);
}
strlcpy(&saddr.sun_path[1], sockpath, sizeof(saddr.sun_path)-1);
saddrlen = offsetof(struct sockaddr_un, sun_path) + 1 + strlen(&saddr.sun_path[1]);
}
strlcat(base, "/subsystem", sizeof(base));
if (stat(base, &statbuf) == 0) {
scan_subsystem("subsystem", SCAN_SUBSYSTEM);
strlcat(base, "/subsystem", sizeof(base));
if (stat(base, &statbuf) == 0) {
scan_subsystem("subsystem", SCAN_SUBSYSTEM);
strlcat(base, "/class/block", sizeof(base));
if (stat(base, &statbuf) != 0)
scan_block();
strlcat(base, "/class/block", sizeof(base));
if (stat(base, &statbuf) != 0)
scan_block();