-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tinyx: fix SIGINT handling in st and xserver
Pressing ^C in X session is now captured by client apps instead of killing the X server. Pressing ^C in st sends SIGINT to the process inside pty instead of doing nothing. JIRA: RTOS-861, RTOS-889
- Loading branch information
1 parent
052aa3e
commit c07b378
Showing
2 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
diff -ruN a/st.c b/st.c | ||
--- a/st.c 2024-09-02 10:01:36.967676919 +0200 | ||
+++ b/st.c 2024-09-02 11:46:12.263350519 +0200 | ||
@@ -708,6 +709,8 @@ | ||
dup2(s, STDIN_FILENO); | ||
dup2(s, STDOUT_FILENO); | ||
dup2(s, STDERR_FILENO); | ||
+ if(ioctl(s, TIOCSCTTY, NULL) < 0) | ||
+ die("ioctl TIOCSCTTY failed: %s\n", SERRNO); | ||
close(s); | ||
close(m); | ||
execsh(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
diff -ruN a/kdrive/phoenix/phoenix.c b/kdrive/phoenix/phoenix.c | ||
--- a/kdrive/phoenix/phoenix.c 2024-09-02 10:24:29.020264244 +0200 | ||
+++ b/kdrive/phoenix/phoenix.c 2024-09-02 11:36:26.806165111 +0200 | ||
@@ -4,6 +4,7 @@ | ||
#include "kdrive.h" | ||
#include <errno.h> | ||
#include <signal.h> | ||
+#include <termios.h> | ||
#include <sys/stat.h> | ||
#include <sys/ioctl.h> | ||
#include <X11/keysym.h> | ||
@@ -14,6 +15,17 @@ | ||
|
||
static int PhoenixInit(void) | ||
{ | ||
+ int fd; | ||
+ if ((fd = open("/dev/tty0", O_WRONLY, 0)) < 0) { | ||
+ FatalError("PhoenixInit: Cannot open /dev/tty0 (%s)\n", | ||
+ strerror(errno)); | ||
+ } | ||
+ | ||
+ if (ioctl(fd, TIOCNOTTY, NULL) < 0) { | ||
+ FatalError("PhoenixInit: TIOCNOTTY failed\n"); | ||
+ } | ||
+ close(fd); | ||
+ | ||
return 1; | ||
} | ||
|