chiark / gitweb /
udev-acl: allow to skip ACL handling
[elogind.git] / extras / floppy / create_floppy_devices.c
index 14df052cf7b7e4964edc220fb9863ca5735b99cc..2fc05cc4943387d66c2a3014deaeea1b90d2acf0 100644 (file)
@@ -24,7 +24,8 @@
 #include <pwd.h>
 #include <grp.h>
 
-#include "../../udev/udev.h"
+#include "libudev.h"
+#include "libudev-private.h"
 
 static char *table[] = {
        "", "d360", "h1200", "u360", "u720", "h360", "h720",
@@ -66,7 +67,7 @@ int main(int argc, char **argv)
        if (udev == NULL)
                goto exit;
 
-       logging_init("create_floppy_devices");
+       udev_log_init("create_floppy_devices");
        udev_set_log_fn(udev, log_fn);
        udev_selinux_init(udev);
 
@@ -137,7 +138,7 @@ int main(int argc, char **argv)
                return 1;
        }
 
-       if (type < 0 || type >= (int) (sizeof(table_sup) / sizeof(table_sup[0]))) {
+       if (type < 0 || type >= (int) ARRAY_SIZE(table_sup)) {
                fprintf(stderr,"Invalid CMOS type %d\n", type);
                return 1;
        }
@@ -164,6 +165,7 @@ int main(int argc, char **argv)
 
        udev_selinux_exit(udev);
        udev_unref(udev);
+       udev_log_close();
 exit:
        return 0;
 }