From cecc4c3f7d79c480409e584e6b26aebedae8a758 Mon Sep 17 00:00:00 2001 From: _ov4 Date: Thu, 13 Aug 2026 12:39:11 +0000 Subject: ok --- tsh.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'tsh.cc') 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; } -- cgit v1.3.1-4-g156e