From f19082b59393a5db046cc75b67aec14c89bb1f29704ab34c124e9aa3e5076597 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Tue, 5 Apr 2016 07:09:23 +0000 Subject: [PATCH] . OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=936 --- ...lock-value-in-etc-sysconfig-keyboard.patch | 21 +++++++------------ systemd.changes | 6 ++++++ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/handle-numlock-value-in-etc-sysconfig-keyboard.patch b/handle-numlock-value-in-etc-sysconfig-keyboard.patch index e3d7c312..54b0c303 100644 --- a/handle-numlock-value-in-etc-sysconfig-keyboard.patch +++ b/handle-numlock-value-in-etc-sysconfig-keyboard.patch @@ -134,7 +134,7 @@ Index: systemd-228/src/vconsole/vconsole-setup.c "COMPOSETABLE", &vc_compose_table, NULL); if (r < 0 && r != -ENOENT) -@@ -421,6 +428,35 @@ int main(int argc, char **argv) { +@@ -421,6 +428,30 @@ int main(int argc, char **argv) { disable_capslock = vc_kbd_disable_caps_lock && strcasecmp(vc_kbd_disable_caps_lock, "YES") == 0; @@ -144,33 +144,28 @@ Index: systemd-228/src/vconsole/vconsole-setup.c + int _cleanup_close_ fdmem; + char c; + ++ errno = 0; + fdmem = open ("/dev/mem", O_RDONLY); -+ if (fdmem < 0) { -+ log_warning_errno(errno, "Failed to open /dev/mem: %m"); ++ if (fdmem < 0) + goto finish; -+ } + -+ if (lseek(fdmem, BIOS_DATA_AREA + BDA_KEYBOARD_STATUS_FLAGS_4, SEEK_SET) == (off_t) -1) { -+ log_warning_errno(errno, "Failed to seek /dev/mem: %m"); ++ if (lseek(fdmem, BIOS_DATA_AREA + BDA_KEYBOARD_STATUS_FLAGS_4, SEEK_SET) == (off_t) -1) + goto finish; -+ } + -+ if (read(fdmem, &c, sizeof(char)) == -1) { -+ log_warning_errno(errno, "Failed to read /dev/mem: %m"); ++ if (read(fdmem, &c, sizeof(char)) == -1) + goto finish; -+ } + + if (c & BDA_KSF4_NUMLOCK_MASK) + numlock = true; + finish: -+ if (fdmem >= 0) -+ close(fdmem); ++ if (errno) ++ log_warning_errno(errno, "Failed to read /dev/mem: %m"); + } +#endif /* x86 */ #endif /* HAVE_SYSV_COMPAT */ r = parse_env_file("/etc/vconsole.conf", NEWLINE, -@@ -456,6 +492,10 @@ int main(int argc, char **argv) { +@@ -456,6 +487,10 @@ int main(int argc, char **argv) { font_ok = font_load_and_wait(vc, vc_font, vc_font_map, vc_font_unimap) > 0; keyboard_ok = keyboard_load_and_wait(vc, vc_keymap, vc_keymap_toggle, utf8, disable_capslock) > 0; diff --git a/systemd.changes b/systemd.changes index b1a32521..4ba2c424 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Apr 5 07:08:39 UTC 2016 - werner@suse.de + +- Fix patch patch handle-numlock-value-in-etc-sysconfig-keyboard.patch + that is do not close a file descriptor twice (boo#973907) + ------------------------------------------------------------------- Sat Mar 26 15:59:36 UTC 2016 - jengelh@inai.de