X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fudev%2Fudevadm-test.c;h=4922b5b6acef92969195141cbc5b7e73a01d18a0;hb=0042d824e3616aaf2e3eec23d3b2e6aec7c0470c;hp=6a2f5489feb5a5e384e8ee76e1c896c5c2b87ef0;hpb=1ea972174baba40dbc80c51cbfc4edc49764b59b;p=elogind.git diff --git a/src/udev/udevadm-test.c b/src/udev/udevadm-test.c index 6a2f5489f..4922b5b6a 100644 --- a/src/udev/udevadm-test.c +++ b/src/udev/udevadm-test.c @@ -25,15 +25,24 @@ #include #include #include -#include #include #include #include "udev.h" #include "udev-util.h" -static int adm_test(struct udev *udev, int argc, char *argv[]) -{ +static void help(void) { + + printf("%s test OPTIONS \n\n" + "Test an event run.\n" + " -h --help Show this help\n" + " --version Show package version\n" + " -a --action=ACTION Set action string\n" + " -N --resolve-names=early|late|never When to resolve names\n" + , program_invocation_short_name); +} + +static int adm_test(struct udev *udev, int argc, char *argv[]) { int resolve_names = 1; char filename[UTIL_PATH_SIZE]; const char *action = "add"; @@ -73,11 +82,7 @@ static int adm_test(struct udev *udev, int argc, char *argv[]) } break; case 'h': - printf("Usage: udevadm test OPTIONS \n" - " -a,--action=ACTION set action string\n" - " -N,--resolve-names=early|late|never when to resolve names\n" - " -h,--help print this help string\n" - "\n"); + help(); exit(EXIT_SUCCESS); case '?': exit(EXIT_FAILURE); @@ -138,7 +143,11 @@ static int adm_test(struct udev *udev, int argc, char *argv[]) goto out; } - udev_event_execute_rules(event, rules, &sigmask_orig); + udev_event_execute_rules(event, + 60 * USEC_PER_SEC, 20 * USEC_PER_SEC, + NULL, + rules, + &sigmask_orig); udev_list_entry_foreach(entry, udev_device_get_properties_list_entry(dev)) printf("%s=%s\n", udev_list_entry_get_name(entry), udev_list_entry_get_value(entry)); @@ -159,6 +168,6 @@ out: const struct udevadm_cmd udevadm_test = { .name = "test", .cmd = adm_test, - .help = "test an event run", + .help = "Test an event run", .debug = true, };