chiark / gitweb /
move syslog wrapper to libudev
[elogind.git] / extras / floppy / create_floppy_devices.c
index 14df052cf7b7e4964edc220fb9863ca5735b99cc..b0d7b0bc85d25d5927732306056bf6b590b5fdd5 100644 (file)
@@ -24,6 +24,8 @@
 #include <pwd.h>
 #include <grp.h>
 
+#include "libudev.h"
+#include "libudev-private.h"
 #include "../../udev/udev.h"
 
 static char *table[] = {
@@ -66,7 +68,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 +139,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 +166,7 @@ int main(int argc, char **argv)
 
        udev_selinux_exit(udev);
        udev_unref(udev);
+       udev_log_close();
 exit:
        return 0;
 }