chiark / gitweb /
fix NAME= and OPTION+="string_escape=..." logic
[elogind.git] / udev / udevadm-test.c
index ceeead0c8af42e812c9a4a1e0dc2ba248ae08169..9d505146cf851a5c5fd3dab942372ca90e0d2c34 100644 (file)
@@ -33,7 +33,6 @@
 int udevadm_test(struct udev *udev, int argc, char *argv[])
 {
        char filename[UTIL_PATH_SIZE];
 int udevadm_test(struct udev *udev, int argc, char *argv[])
 {
        char filename[UTIL_PATH_SIZE];
-       int force = 0;
        const char *action = "add";
        const char *syspath = NULL;
        struct udev_event *event;
        const char *action = "add";
        const char *syspath = NULL;
        struct udev_event *event;
@@ -44,7 +43,6 @@ int udevadm_test(struct udev *udev, int argc, char *argv[])
 
        static const struct option options[] = {
                { "action", required_argument, NULL, 'a' },
 
        static const struct option options[] = {
                { "action", required_argument, NULL, 'a' },
-               { "force", no_argument, NULL, 'f' },
                { "help", no_argument, NULL, 'h' },
                {}
        };
                { "help", no_argument, NULL, 'h' },
                {}
        };
@@ -63,13 +61,9 @@ int udevadm_test(struct udev *udev, int argc, char *argv[])
                case 'a':
                        action = optarg;
                        break;
                case 'a':
                        action = optarg;
                        break;
-               case 'f':
-                       force = 1;
-                       break;
                case 'h':
                        printf("Usage: udevadm test OPTIONS <syspath>\n"
                               "  --action=<string>     set action string\n"
                case 'h':
                        printf("Usage: udevadm test OPTIONS <syspath>\n"
                               "  --action=<string>     set action string\n"
-                              "  --force               don't skip node/link creation\n"
                               "  --help                print this help text\n\n");
                        exit(0);
                default:
                               "  --help                print this help text\n\n");
                        exit(0);
                default:
@@ -89,7 +83,7 @@ int udevadm_test(struct udev *udev, int argc, char *argv[])
               "some values may be different, or not available at a simulation run.\n"
               "\n");
 
               "some values may be different, or not available at a simulation run.\n"
               "\n");
 
-       rules = udev_rules_new(udev, 0);
+       rules = udev_rules_new(udev, 1);
        if (rules == NULL) {
                fprintf(stderr, "error reading rules\n");
                rc = 1;
        if (rules == NULL) {
                fprintf(stderr, "error reading rules\n");
                rc = 1;
@@ -116,11 +110,6 @@ int udevadm_test(struct udev *udev, int argc, char *argv[])
 
        udev_device_set_action(dev, action);
        event = udev_event_new(dev);
 
        udev_device_set_action(dev, action);
        event = udev_event_new(dev);
-
-       /* simulate node creation with test flag */
-       if (!force)
-               event->test = 1;
-
        err = udev_event_execute_rules(event, rules);
 
        if (udev_device_get_event_timeout(dev) >= 0)
        err = udev_event_execute_rules(event, rules);
 
        if (udev_device_get_event_timeout(dev) >= 0)