diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-10-12 20:28:21 -0400 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-10-13 17:56:55 -0400 |
commit | 1ca208fb4f93e5869704af1812cbff7130a2fc03 (patch) | |
tree | 689343b99c76e4d34c625197762de97e8435571d /src/fsck | |
parent | b506291ff195e03ce793ac925cc2d158f0b452b5 (diff) |
Introduce udev object cleanup functions
Diffstat (limited to 'src/fsck')
-rw-r--r-- | src/fsck/fsck.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/fsck/fsck.c b/src/fsck/fsck.c index f298cf7b9a..96a79ddcdb 100644 --- a/src/fsck/fsck.c +++ b/src/fsck/fsck.c @@ -27,7 +27,6 @@ #include <fcntl.h> #include <sys/file.h> -#include <libudev.h> #include <dbus/dbus.h> #include "util.h" @@ -36,6 +35,8 @@ #include "bus-errors.h" #include "virt.h" #include "fileio.h" +#include "libudev.h" +#include "udev-util.h" static bool arg_skip = false; static bool arg_force = false; @@ -251,8 +252,8 @@ int main(int argc, char *argv[]) { int i = 0, r = EXIT_FAILURE, q; pid_t pid; siginfo_t status; - struct udev *udev = NULL; - struct udev_device *udev_device = NULL; + _cleanup_udev_unref_ struct udev *udev = NULL; + _cleanup_udev_device_unref_ struct udev_device *udev_device = NULL; const char *device; bool root_directory; int progress_pipe[2] = { -1, -1 }; @@ -400,12 +401,6 @@ int main(int argc, char *argv[]) { touch("/run/systemd/quotacheck"); finish: - if (udev_device) - udev_device_unref(udev_device); - - if (udev) - udev_unref(udev); - close_pipe(progress_pipe); return r; |