chiark / gitweb /
move syslog wrapper to libudev
[elogind.git] / udev / udevadm.c
index 2de9fbcf2212680be0474b0553b3f3e39faabfd9..99ac3300829ae9c8382e0f79928e323835c6d767 100644 (file)
@@ -79,7 +79,7 @@ static const struct command cmds[] = {
        },
        {
                .name = "settle",
-               .cmd = udevadm_settle, "",
+               .cmd = udevadm_settle,
                .help = "wait for the event queue to finish",
        },
        {
@@ -138,7 +138,7 @@ int main(int argc, char *argv[])
        if (udev == NULL)
                goto out;
 
-       logging_init("udevadm");
+       udev_log_init("udevadm");
        udev_set_log_fn(udev, log_fn);
        udev_selinux_init(udev);
 
@@ -200,7 +200,9 @@ int main(int argc, char *argv[])
        if (command != NULL)
                for (i = 0; cmds[i].cmd != NULL; i++) {
                        if (strcmp(cmds[i].name, command) == 0) {
-                               optind++;
+                               argc -= optind;
+                               argv += optind;
+                               optind = 0;
                                rc = run_command(udev, &cmds[i], argc, argv);
                                goto out;
                        }
@@ -212,6 +214,6 @@ int main(int argc, char *argv[])
 out:
        udev_selinux_exit(udev);
        udev_unref(udev);
-       logging_close();
+       udev_log_close();
        return rc;
 }