chiark / gitweb /
Remove src/libudev
[elogind.git] / src / locale / localectl.c
index cb2920974c8941f653fb6bb3bb3dc41032f1c9b6..515fca540aa3a3f465624c1b57854728c96d9875 100644 (file)
 #include <locale.h>
 #include <stdlib.h>
 #include <stdbool.h>
-#include <unistd.h>
 #include <getopt.h>
 #include <string.h>
 #include <ftw.h>
-#include <sys/mman.h>
-#include <fcntl.h>
 
 #include "sd-bus.h"
 #include "bus-util.h"
 #include "bus-error.h"
-#include "bus-message.h"
 #include "util.h"
 #include "spawn-polkit-agent.h"
 #include "build.h"
 #include "strv.h"
 #include "pager.h"
 #include "set.h"
-#include "path-util.h"
-#include "utf8.h"
 #include "def.h"
 #include "virt.h"
 #include "fileio.h"
@@ -401,10 +395,8 @@ static int list_x11_keymaps(sd_bus *bus, char **args, unsigned n) {
         }
 
         f = fopen("/usr/share/X11/xkb/rules/base.lst", "re");
-        if (!f) {
-                log_error("Failed to open keyboard mapping list. %m");
-                return -errno;
-        }
+        if (!f)
+                return log_error_errno(errno, "Failed to open keyboard mapping list. %m");
 
         if (streq(args[0], "list-x11-keymap-models"))
                 look_for = MODELS;
@@ -499,10 +491,10 @@ static void help(void) {
                "  status                   Show current locale settings\n"
                "  set-locale LOCALE...     Set system locale\n"
                "  list-locales             Show known locales\n"
-               "  set-keymap MAP [MAP]     Set virtual console keyboard mapping\n"
+               "  set-keymap MAP [MAP]     Set console and X11 keyboard mappings\n"
                "  list-keymaps             Show known virtual console keyboard mappings\n"
                "  set-x11-keymap LAYOUT [MODEL [VARIANT [OPTIONS]]]\n"
-               "                           Set X11 keyboard mapping\n"
+               "                           Set X11 and console keyboard mappings\n"
                "  list-x11-keymap-models   Show known X11 keyboard mapping models\n"
                "  list-x11-keymap-layouts  Show known X11 keyboard mapping layouts\n"
                "  list-x11-keymap-variants [LAYOUT]\n"
@@ -567,7 +559,7 @@ static int parse_argv(int argc, char *argv[]) {
                         break;
 
                 case 'M':
-                        arg_transport = BUS_TRANSPORT_CONTAINER;
+                        arg_transport = BUS_TRANSPORT_MACHINE;
                         arg_host = optarg;
                         break;