X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Ffsck%2Ffsck.c;h=96a79ddcdb6b0a3581919860eca0584d0620f167;hp=f298cf7b9ab82d2f5f00c9a655d34942e94d9b4b;hb=1ca208fb4f93e5869704af1812cbff7130a2fc03;hpb=b506291ff195e03ce793ac925cc2d158f0b452b5 diff --git a/src/fsck/fsck.c b/src/fsck/fsck.c index f298cf7b9..96a79ddcd 100644 --- a/src/fsck/fsck.c +++ b/src/fsck/fsck.c @@ -27,7 +27,6 @@ #include #include -#include #include #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;