Fix setfont exit code

This commit is contained in:
Vitezslav Crhonek 2021-05-17 13:43:18 +02:00
parent 9965872c1c
commit 32d82956ad
2 changed files with 22 additions and 1 deletions

View File

@ -0,0 +1,14 @@
diff -up kbd-2.4.0/src/setfont.c.orig kbd-2.4.0/src/setfont.c
--- kbd-2.4.0/src/setfont.c.orig 2020-06-02 11:30:41.000000000 +0200
+++ kbd-2.4.0/src/setfont.c 2021-05-17 12:06:44.360616147 +0200
@@ -189,8 +189,8 @@ int main(int argc, char *argv[])
if (restore)
kfont_restore_font(kfont, fd);
- if (ifilct)
- kfont_load_fonts(kfont, fd, ifiles, ifilct, iunit, hwunit, no_m, no_u);
+ if (ifilct && (ret = kfont_load_fonts(kfont, fd, ifiles, ifilct, iunit, hwunit, no_m, no_u)) < 0)
+ return -ret;
if (ufil && (ret = kfont_load_unicodemap(kfont, fd, ufil)) < 0)
return -ret;

View File

@ -5,7 +5,7 @@
Name: kbd Name: kbd
Version: 2.4.0 Version: 2.4.0
Release: 5%{?dist} Release: 6%{?dist}
Summary: Tools for configuring the console (keyboard, virtual terminals, etc.) Summary: Tools for configuring the console (keyboard, virtual terminals, etc.)
License: GPLv2+ License: GPLv2+
URL: http://www.kbd-project.org/ URL: http://www.kbd-project.org/
@ -36,6 +36,8 @@ Patch6: kbd-2.0.2-unicode-start-font.patch
Patch7: kbd-2.0.4-covscan-fixes.patch Patch7: kbd-2.0.4-covscan-fixes.patch
# Patch8: fixes another batch of issues found by static analysis # Patch8: fixes another batch of issues found by static analysis
Patch8: kbd-2.4.0-covscan-fixes.patch Patch8: kbd-2.4.0-covscan-fixes.patch
# Patch9: fixes setfont exit code, bz 1947953
Patch9: kbd-2.4.0-setfont-exit-code.patch
BuildRequires: gcc, bison, flex, gettext, pam-devel, check-devel, automake BuildRequires: gcc, bison, flex, gettext, pam-devel, check-devel, automake
BuildRequires: console-setup, xkeyboard-config BuildRequires: console-setup, xkeyboard-config
@ -81,6 +83,7 @@ cp -fp %{SOURCE6} .
%patch6 -p1 -b .unicode-start-font %patch6 -p1 -b .unicode-start-font
%patch7 -p1 -b .covscan-fixes %patch7 -p1 -b .covscan-fixes
%patch8 -p1 -b .covscan-fixes-pt2 %patch8 -p1 -b .covscan-fixes-pt2
%patch9 -p1 -b .setfont-exit-code
aclocal aclocal
autoconf autoconf
@ -200,6 +203,10 @@ make check
%{kbd_datadir}/keymaps/legacy %{kbd_datadir}/keymaps/legacy
%changelog %changelog
* Mon May 17 2021 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.4.0-6
- Fix setfont exit code
Resolves: #1947953
* Wed May 05 2021 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.4.0-5 * Wed May 05 2021 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.4.0-5
- Fix issues detected by static analysis - Fix issues detected by static analysis
Resolves: #1938749 Resolves: #1938749