parent
b2f696ae6e
commit
7bc93a72c0
@ -1,43 +0,0 @@
|
|||||||
From 704e4ce6c334dcf5db1fe9af22eabd335cebb775 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Aleix Pol <aleixpol@kde.org>
|
|
||||||
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
|
|
||||||
|
|
@ -1 +1 @@
|
|||||||
SHA512 (sddm-5ad9f19d958e69e9c3f08baa9161794ceafe4da7.tar.gz) = c949a361144fdd562cfaf5eaff3f0bbd2ea6e4df664d9e4a2d7dd05680da44c537428e50ff2dcf0ea50a1c3cafa2a15609ecd0b9294b537909dc53ead2781683
|
SHA512 (sddm-c257a40ba95f56b5f3830b923b1c56aa055cf8ea.tar.gz) = 48a164c45774b6d19abc8d9664ec1e8c1921746ba7e5ecc3f726e6221957fb86fea43c483b067f4caa78ea2a3699cd3066c5e93e2b7256098a985a2425ddcc65
|
||||||
|
Loading…
Reference in new issue