diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2008-10-18 15:02:01 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@vrfy.org> | 2008-10-18 15:02:01 +0200 |
commit | d7ddce186c8a0171eb98862b6f8ff72d64261b33 (patch) | |
tree | ddacebf3401680c0e5da78132c3c7ed03b23519f /udev/udevadm-test.c | |
parent | c7521974a39bcb68f313a324b8ec60ec11fed3d8 (diff) |
make struct udev_rules opaque
Diffstat (limited to 'udev/udevadm-test.c')
-rw-r--r-- | udev/udevadm-test.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/udev/udevadm-test.c b/udev/udevadm-test.c index 99f6c36dde..c64e0456bb 100644 --- a/udev/udevadm-test.c +++ b/udev/udevadm-test.c @@ -38,7 +38,7 @@ int udevadm_test(struct udev *udev, int argc, char *argv[]) const char *syspath = NULL; struct udev_event *event; struct udev_device *dev; - struct udev_rules rules = {}; + struct udev_rules *rules = NULL; int err; int rc = 0; @@ -89,7 +89,12 @@ int udevadm_test(struct udev *udev, int argc, char *argv[]) "some values may be different, or not available at a simulation run.\n" "\n"); - udev_rules_init(udev, &rules, 0); + rules = udev_rules_new(udev, 0); + if (rules == NULL) { + fprintf(stderr, "error reading rules\n"); + rc = 1; + goto exit; + } /* add /sys if needed */ if (strncmp(syspath, udev_get_sys_path(udev), strlen(udev_get_sys_path(udev))) != 0) { @@ -116,7 +121,7 @@ int udevadm_test(struct udev *udev, int argc, char *argv[]) if (!force) event->test = 1; - err = udev_event_run(event, &rules); + err = udev_event_run(event, rules); if (udev_device_get_event_timeout(dev) >= 0) info(udev, "custom event timeout: %i\n", udev_device_get_event_timeout(dev)); @@ -135,6 +140,6 @@ int udevadm_test(struct udev *udev, int argc, char *argv[]) udev_event_unref(event); udev_device_unref(dev); exit: - udev_rules_cleanup(&rules); + udev_rules_unref(rules); return rc; } |