chiark / gitweb /
Merge keymap building in the top-level Makefile.am.
[elogind.git] / udev / udevadm.c
index 3671b9ee590148c4f3c137ce9fce677830b94c83..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,10 +138,9 @@ 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);
-       selinux_init(udev);
-       sysfs_init();
+       udev_selinux_init(udev);
 
        /* see if we are a compat link, this will be removed in a future release */
        command = argv[0];
@@ -201,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;
                        }
@@ -211,9 +212,8 @@ int main(int argc, char *argv[])
        help(udev, argc, argv);
        rc = 2;
 out:
-       sysfs_cleanup();
-       selinux_exit(udev);
+       udev_selinux_exit(udev);
        udev_unref(udev);
-       logging_close();
+       udev_log_close();
        return rc;
 }