aboutsummaryrefslogtreecommitdiff
path: root/tsh.cc
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-08-13 12:39:11 +0000
committer_ov4 <ov4@ov4.org>2026-08-13 12:39:11 +0000
commitcecc4c3f7d79c480409e584e6b26aebedae8a758 (patch)
treeebb03db6144396c805f55de0676725f85a3263cc /tsh.cc
parenta687c62a8d53ded7b50a64d3c3b7eeb07800af30 (diff)
ok
Diffstat (limited to 'tsh.cc')
-rw-r--r--tsh.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/tsh.cc b/tsh.cc
index bc550ab..198dde0 100644
--- a/tsh.cc
+++ b/tsh.cc
@@ -215,12 +215,12 @@ void eval(char *cmdline)
if (pid == 0) // child
{
sigprocmask(SIG_UNBLOCK, &mask_sigchld, NULL);
- pid = getpid();
- setpgid(pid, pid);
+ setpgid(0, 0);
execve(argv[0], argv, NULL);
- atomic_print("log: command not found\n");
+ atomic_print(cmdline, true);
+ atomic_print(": Command not found\n");
exit(-1); // if no command is found
}
@@ -409,7 +409,10 @@ void waitfg(pid_t pid)
LOG << "finished fg " << endl;
if ((j->state == ST))
{
- cout << "[" << j->jid << "] (" << pid << ") Stopped " << j->cmdline << endl;
+ cout << "Job [" << j->jid << "] (" << pid << ") stopped by signal 20" << endl;
+ } else if (getjobpid(jobs, pid) == nullptr)
+ {
+ cout << "Job [" << j->jid << "] (" << pid << ") terminated by signal 2" << endl;
}
return;
}