diff options
author | Adrian Szyndela <adrian.s@samsung.com> | 2020-02-17 13:23:57 +0100 |
---|---|---|
committer | Adrian Szyndela <adrian.s@samsung.com> | 2020-02-26 12:21:20 +0100 |
commit | 8c75c63b9c27c5fd76c8029a315ff7dcf4d29ab4 (patch) | |
tree | dac037a5f82119253e1556eb8684ea8a91e5fed8 /src/locale | |
parent | 71dda51708c0f9cafff337fda0a02322981dc48c (diff) | |
parent | c1719d8bc924ed59448616bd748671c5c7a66d93 (diff) | |
download | systemd-8c75c63b9c27c5fd76c8029a315ff7dcf4d29ab4.tar.gz systemd-8c75c63b9c27c5fd76c8029a315ff7dcf4d29ab4.tar.bz2 systemd-8c75c63b9c27c5fd76c8029a315ff7dcf4d29ab4.zip |
Merge v235 into tizen
Change-Id: Iafcca23df73f2694eda50a97771acac4b7996f30
Diffstat (limited to 'src/locale')
-rw-r--r-- | src/locale/.gitignore | 1 | ||||
l--------- | src/locale/Makefile | 1 | ||||
-rw-r--r-- | src/locale/keymap-util.c | 24 | ||||
-rw-r--r-- | src/locale/localed.c | 4 | ||||
-rw-r--r-- | src/locale/meson.build | 4 |
5 files changed, 15 insertions, 19 deletions
diff --git a/src/locale/.gitignore b/src/locale/.gitignore deleted file mode 100644 index b1e0ba755e..0000000000 --- a/src/locale/.gitignore +++ /dev/null @@ -1 +0,0 @@ -org.freedesktop.locale1.policy diff --git a/src/locale/Makefile b/src/locale/Makefile deleted file mode 120000 index d0b0e8e008..0000000000 --- a/src/locale/Makefile +++ /dev/null @@ -1 +0,0 @@ -../Makefile
\ No newline at end of file diff --git a/src/locale/keymap-util.c b/src/locale/keymap-util.c index 105d9b0ee4..b71091f706 100644 --- a/src/locale/keymap-util.c +++ b/src/locale/keymap-util.c @@ -39,7 +39,7 @@ static bool startswith_comma(const char *s, const char *prefix) { if (!s) return false; - return *s == ',' || *s == '\0'; + return IN_SET(*s, ',', '\0'); } static const char* strnulldash(const char *s) { @@ -177,7 +177,7 @@ static int x11_read_data(Context *c) { char_array_0(line); l = strstrip(line); - if (l[0] == 0 || l[0] == '#') + if (IN_SET(l[0], 0, '#')) continue; if (in_section && first_word(l, "Option")) { @@ -361,12 +361,12 @@ int x11_write_data(Context *c) { fchmod(fileno(f), 0644); - fputs("# Written by systemd-localed(8), read by systemd-localed and Xorg. It's\n" - "# probably wise not to edit this file manually. Use localectl(1) to\n" - "# instruct systemd-localed to update it.\n" - "Section \"InputClass\"\n" - " Identifier \"system-keyboard\"\n" - " MatchIsKeyboard \"on\"\n", f); + fputs_unlocked("# Written by systemd-localed(8), read by systemd-localed and Xorg. It's\n" + "# probably wise not to edit this file manually. Use localectl(1) to\n" + "# instruct systemd-localed to update it.\n" + "Section \"InputClass\"\n" + " Identifier \"system-keyboard\"\n" + " MatchIsKeyboard \"on\"\n", f); if (!isempty(c->x11_layout)) fprintf(f, " Option \"XkbLayout\" \"%s\"\n", c->x11_layout); @@ -380,9 +380,9 @@ int x11_write_data(Context *c) { if (!isempty(c->x11_options)) fprintf(f, " Option \"XkbOptions\" \"%s\"\n", c->x11_options); - fputs("EndSection\n", f); + fputs_unlocked("EndSection\n", f); - r = fflush_and_check(f); + r = fflush_sync_and_check(f); if (r < 0) goto fail; @@ -394,8 +394,6 @@ int x11_write_data(Context *c) { return 0; fail: - (void) unlink("/etc/X11/xorg.conf.d/00-keyboard.conf"); - if (temp_path) (void) unlink(temp_path); @@ -427,7 +425,7 @@ static int read_next_mapping(const char* filename, (*n)++; l = strstrip(line); - if (l[0] == 0 || l[0] == '#') + if (IN_SET(l[0], 0, '#')) continue; r = strv_split_extract(&b, l, WHITESPACE, EXTRACT_QUOTES); diff --git a/src/locale/localed.c b/src/locale/localed.c index b4798d674c..3c0c167dcf 100644 --- a/src/locale/localed.c +++ b/src/locale/localed.c @@ -22,7 +22,7 @@ #include <string.h> #include <unistd.h> -#ifdef HAVE_XKBCOMMON +#if HAVE_XKBCOMMON #include <xkbcommon/xkbcommon.h> #include <dlfcn.h> #endif @@ -429,7 +429,7 @@ static int method_set_vc_keyboard(sd_bus_message *m, void *userdata, sd_bus_erro return sd_bus_reply_method_return(m, NULL); } -#ifdef HAVE_XKBCOMMON +#if HAVE_XKBCOMMON _printf_(3, 0) static void log_xkb(struct xkb_context *ctx, enum xkb_log_level lvl, const char *format, va_list args) { diff --git a/src/locale/meson.build b/src/locale/meson.build index d7dd113c8d..e9de6089f3 100644 --- a/src/locale/meson.build +++ b/src/locale/meson.build @@ -6,7 +6,7 @@ systemd_localed_sources = files(''' localectl_sources = files('localectl.c') -if conf.get('ENABLE_LOCALED', false) +if conf.get('ENABLE_LOCALED') == 1 install_data('org.freedesktop.locale1.conf', install_dir : dbuspolicydir) install_data('org.freedesktop.locale1.service', @@ -27,7 +27,7 @@ endif kbd_model_map = join_paths(meson.current_source_dir(), 'kbd-model-map') language_fallback_map = join_paths(meson.current_source_dir(), 'language-fallback-map') -if conf.get('ENABLE_LOCALED', false) +if conf.get('ENABLE_LOCALED') == 1 install_data('kbd-model-map', 'language-fallback-map', install_dir : pkgdatadir) |