mirror of
https://git.suckless.org/st
synced 2026-07-16 04:53:54 +02:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
04ce0d643e | ||
|
|
688f70add0 | ||
|
|
0723b7e39e |
25
st.c
25
st.c
@@ -712,19 +712,24 @@ execsh(char *cmd, char **args)
|
||||
void
|
||||
sigchld(int a)
|
||||
{
|
||||
int stat;
|
||||
int stat, olderrno;
|
||||
pid_t p;
|
||||
|
||||
if ((p = waitpid(pid, &stat, WNOHANG)) < 0)
|
||||
die("waiting for pid %hd failed: %s\n", pid, strerror(errno));
|
||||
olderrno = errno;
|
||||
do {
|
||||
p = waitpid(pid, &stat, WNOHANG);
|
||||
} while (p < 0 && errno == EINTR);
|
||||
|
||||
if (pid != p)
|
||||
if (p < 0)
|
||||
_exit(1);
|
||||
|
||||
if (pid != p) {
|
||||
errno = olderrno;
|
||||
return;
|
||||
}
|
||||
|
||||
if (WIFEXITED(stat) && WEXITSTATUS(stat))
|
||||
die("child exited with status %d\n", WEXITSTATUS(stat));
|
||||
else if (WIFSIGNALED(stat))
|
||||
die("child terminated due to signal %d\n", WTERMSIG(stat));
|
||||
if ((WIFEXITED(stat) && WEXITSTATUS(stat)) || WIFSIGNALED(stat))
|
||||
_exit(1);
|
||||
_exit(0);
|
||||
}
|
||||
|
||||
@@ -965,6 +970,9 @@ tsetdirt(int top, int bot)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (term.row <= 0)
|
||||
return;
|
||||
|
||||
LIMIT(top, 0, term.row-1);
|
||||
LIMIT(bot, 0, term.row-1);
|
||||
|
||||
@@ -2358,6 +2366,7 @@ eschandle(uchar ascii)
|
||||
resettitle();
|
||||
xloadcols();
|
||||
xsetmode(0, MODE_HIDE);
|
||||
xsetmode(0, MODE_BRCKTPASTE);
|
||||
break;
|
||||
case '=': /* DECPAM -- Application keypad */
|
||||
xsetmode(1, MODE_APPKEYPAD);
|
||||
|
||||
Reference in New Issue
Block a user