aboutsummaryrefslogtreecommitdiff
path: root/tsh.cc
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-08-13 14:10:56 +0000
committer_ov4 <ov4@ov4.org>2026-08-13 14:10:56 +0000
commit0d4e2b4a3b229e19677ba98d5de0346dc7c8b2c3 (patch)
treeff4c6da33f1d21d6ea1713c30d167679640bf3da /tsh.cc
parent2bd8d169a0e9bc6d413c1ed7338cf410929f7104 (diff)
errno restore
Diffstat (limited to 'tsh.cc')
-rw-r--r--tsh.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/tsh.cc b/tsh.cc
index 72263e0..9253c8f 100644
--- a/tsh.cc
+++ b/tsh.cc
@@ -485,11 +485,17 @@ void sigchld_handler(int sig)
*/
void sigint_handler(int sig)
{
+ int errno_backup = errno;
+
+
int pid = fgpid(jobs);
if (pid != 0)
{
kill(-pid, SIGINT);
}
+
+
+ errno = errno_backup;
return;
}
@@ -500,11 +506,17 @@ void sigint_handler(int sig)
*/
void sigtstp_handler(int sig)
{
+ int errno_backup = errno;
+
+
int pid = fgpid(jobs);
if (pid != 0)
{
kill(-pid, SIGTSTP);
}
+
+
+ errno = errno_backup;
return;
}