X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Flocale%2Flocalectl.c;h=5d35f9cdae4dbda4bda1974df2e5406b0cc19087;hb=9261bb7c5058fd543e42020f72f5762349f92c65;hp=c05eba0d3edebfcdedbf1cc20d47230547ddae3b;hpb=2087a7aff26ea5d1bc2c7c29add3275328f36baa;p=elogind.git
diff --git a/src/locale/localectl.c b/src/locale/localectl.c
index c05eba0d3..5d35f9cda 100644
--- a/src/locale/localectl.c
+++ b/src/locale/localectl.c
@@ -19,6 +19,7 @@
along with systemd; If not, see .
***/
+#include
#include
#include
#include
@@ -354,7 +355,8 @@ static int list_locales(DBusConnection *bus, char **args, unsigned n) {
h->locrectab_offset + h->locrectab_size > st.st_size ||
h->sumhash_offset + h->sumhash_size > st.st_size) {
log_error("Invalid archive file.");
- return -EBADMSG;
+ r = -EBADMSG;
+ goto finish;
}
e = (const struct namehashent*) ((const uint8_t*) p + h->namehash_offset);
@@ -482,7 +484,8 @@ static int nftw_cb(
}
static int list_vconsole_keymaps(DBusConnection *bus, char **args, unsigned n) {
- char **l, **i;
+ char _cleanup_strv_free_ **l = NULL;
+ char **i;
keymaps = set_new(string_hash_func, string_compare_func);
if (!keymaps)
@@ -512,7 +515,6 @@ static int list_vconsole_keymaps(DBusConnection *bus, char **args, unsigned n) {
STRV_FOREACH(i, l)
puts(*i);
- strv_free(l);
return 0;
}
@@ -535,7 +537,7 @@ static int set_x11_keymap(DBusConnection *bus, char **args, unsigned n) {
layout = args[1];
model = n > 2 ? args[2] : "";
variant = n > 3 ? args[3] : "";
- options = n > 3 ? args[4] : "";
+ options = n > 4 ? args[4] : "";
b = arg_convert;
return bus_method_call_with_reply(
@@ -613,7 +615,6 @@ static int parse_argv(int argc, char *argv[]) {
case ARG_VERSION:
puts(PACKAGE_STRING);
- puts(DISTRIBUTION);
puts(SYSTEMD_FEATURES);
return 0;
@@ -739,6 +740,7 @@ int main(int argc, char *argv[]) {
dbus_error_init(&error);
+ setlocale(LC_ALL, "");
log_parse_environment();
log_open();