diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-12-17 21:49:07 -0500 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-12-18 23:58:23 -0500 |
commit | 44433ebdb14d83750e0acdc4b3630b64f1fa18af (patch) | |
tree | 5793416d37dd421641cf78d9127fa73e2f0dc6ea /src/udev/udevadm-test.c | |
parent | 7643ac9a8add1f07ffc237c054feb443b5612717 (diff) |
udevadm: modernization
Diffstat (limited to 'src/udev/udevadm-test.c')
-rw-r--r-- | src/udev/udevadm-test.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/udev/udevadm-test.c b/src/udev/udevadm-test.c index cd75fad674..a9f9cafc0b 100644 --- a/src/udev/udevadm-test.c +++ b/src/udev/udevadm-test.c @@ -30,6 +30,7 @@ #include <sys/signalfd.h> #include "udev.h" +#include "udev-util.h" static int adm_test(struct udev *udev, int argc, char *argv[]) { @@ -37,10 +38,10 @@ static int adm_test(struct udev *udev, int argc, char *argv[]) char filename[UTIL_PATH_SIZE]; const char *action = "add"; const char *syspath = NULL; - struct udev_event *event = NULL; - struct udev_device *dev = NULL; - struct udev_rules *rules = NULL; struct udev_list_entry *entry; + _cleanup_udev_rules_unref_ struct udev_rules *rules = NULL; + _cleanup_udev_device_unref_ struct udev_device *dev = NULL; + _cleanup_udev_event_unref_ struct udev_event *event = NULL; sigset_t mask, sigmask_orig; int err; int rc = 0, c; @@ -154,9 +155,6 @@ static int adm_test(struct udev *udev, int argc, char *argv[]) out: if (event != NULL && event->fd_signal >= 0) close(event->fd_signal); - udev_event_unref(event); - udev_device_unref(dev); - udev_rules_unref(rules); udev_builtin_exit(udev); return rc; } |