chiark / gitweb /
update a few years of copyright
[elogind.git] / udev / udevadm.c
index 2de9fbcf2212680be0474b0553b3f3e39faabfd9..b7295f32964f00f5ffce8ec7a71ff5a13bfbd6a1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2008 Kay Sievers <kay.sievers@vrfy.org>
+ * Copyright (C) 2007-2009 Kay Sievers <kay.sievers@vrfy.org>
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -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;
 }