diff options
Diffstat (limited to 'test/test-udev.c')
-rw-r--r-- | test/test-udev.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/test/test-udev.c b/test/test-udev.c index fd4388a678..b3ff9a94cc 100644 --- a/test/test-udev.c +++ b/test/test-udev.c @@ -31,9 +31,10 @@ #include <sched.h> #include <sys/mount.h> #include <sys/signalfd.h> -#include <linux/fs.h> +#include "missing.h" #include "udev.h" +#include "udev-util.h" #ifndef HAVE_UNSHARE #include <sys/syscall.h> @@ -91,10 +92,10 @@ out: } int main(int argc, char *argv[]) { - struct udev *udev = NULL; - struct udev_event *event = NULL; - struct udev_device *dev = NULL; - struct udev_rules *rules = NULL; + _cleanup_udev_unref_ struct udev *udev = NULL; + _cleanup_udev_event_unref_ struct udev_event *event = NULL; + _cleanup_udev_device_unref_ struct udev_device *dev = NULL; + _cleanup_udev_rules_unref_ struct udev_rules *rules = NULL; char syspath[UTIL_PATH_SIZE]; const char *devpath; const char *action; @@ -169,10 +170,7 @@ int main(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); label_finish(); - udev_unref(udev); + return err ? EXIT_FAILURE : EXIT_SUCCESS; } |