From b2f696ae6e9e69a93de77799bf3e63c9cb9c1794 Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Fri, 25 Feb 2022 14:27:53 -0500 Subject: [PATCH] Add proposed patch to not ignore EINTR when activating --- ...-do-not-ignore-EINTR-when-activating.patch | 43 +++++++++++++++++++ sddm.spec | 9 +++- 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 0001-VirtualTerminal-do-not-ignore-EINTR-when-activating.patch diff --git a/0001-VirtualTerminal-do-not-ignore-EINTR-when-activating.patch b/0001-VirtualTerminal-do-not-ignore-EINTR-when-activating.patch new file mode 100644 index 0000000..80dd78b --- /dev/null +++ b/0001-VirtualTerminal-do-not-ignore-EINTR-when-activating.patch @@ -0,0 +1,43 @@ +From 704e4ce6c334dcf5db1fe9af22eabd335cebb775 Mon Sep 17 00:00:00 2001 +From: Aleix Pol +Date: Fri, 25 Feb 2022 03:02:40 +0100 +Subject: [PATCH] VirtualTerminal: do not ignore EINTR when activating + +EINTR can be called at any time when a signal is received but here we +still need to follow through with both ioctl() calls. + +This change is inspired by how xserver does more or less the same thing. +--- + src/common/VirtualTerminal.cpp | 15 ++++++++++++--- + 1 file changed, 12 insertions(+), 3 deletions(-) + +diff --git a/src/common/VirtualTerminal.cpp b/src/common/VirtualTerminal.cpp +index e1330af..7791caf 100644 +--- a/src/common/VirtualTerminal.cpp ++++ b/src/common/VirtualTerminal.cpp +@@ -211,10 +211,19 @@ out: + if (!vt_auto) + handleVtSwitches(fd); + +- if (ioctl(fd, VT_ACTIVATE, vt) < 0) ++ int ret; ++ while ((ret = ioctl(fd, VT_ACTIVATE, vt) < 0) && errno == EINTR) ++ {} ++ ++ if (ret < 0) + qWarning("Couldn't initiate jump to VT %d: %s", vt, strerror(errno)); +- else if (ioctl(fd, VT_WAITACTIVE, vt) < 0) +- qWarning("Couldn't finalize jump to VT %d: %s", vt, strerror(errno)); ++ else { ++ while ((ret = ioctl(fd, VT_WAITACTIVE, vt) < 0) && errno == EINTR) ++ {} ++ ++ if (ret < 0) ++ qWarning("Couldn't finalize jump to VT %d: %s", vt, strerror(errno)); ++ } + + close(activeVtFd); + if (vtFd != -1) +-- +2.34.1 + diff --git a/sddm.spec b/sddm.spec index 36b2136..8e88d7b 100644 --- a/sddm.spec +++ b/sddm.spec @@ -20,7 +20,7 @@ Name: sddm Version: 0.19.0%{?commitdate:^git%{commitdate}.%{shortcommit}} -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ Summary: QML based desktop and login manager @@ -48,6 +48,10 @@ Patch10: sddm-0.20.0-allow-hiding-wayland-sessions.patch # Submmited: https://github.com/sddm/sddm/pull/1494 Patch11: 0001-Delay-for-logind-and-fallback-to-seat0.patch +# VirtualTerminal: do not ignore EINTR when activating +# Submitted: https://github.com/sddm/sddm/pull/1521 +Patch12: 0001-VirtualTerminal-do-not-ignore-EINTR-when-activating.patch + ## downstream patches Patch101: sddm-0.20.0-fedora_config.patch @@ -299,6 +303,9 @@ fi %changelog +* Fri Feb 25 2022 Neal Gompa - 0.19.0^git20220224.5ad9f19-2 +- Add proposed patch to not ignore EINTR when activating + * Fri Feb 25 2022 Neal Gompa - 0.19.0^git20220224.5ad9f19-1 - Update to new snapshot release