Преглед изворни кода

Shell: Don't spam perror() on kill_job()

That function is allowed to be given a dead job, so don't bother with
perror()
AnotherTest пре 4 година
родитељ
комит
cb29dca029
1 измењених фајлова са 2 додато и 1 уклоњено
  1. 2 1
      Userland/Shell/Shell.cpp

+ 2 - 1
Userland/Shell/Shell.cpp

@@ -1833,7 +1833,8 @@ void Shell::kill_job(const Job* job, int sig)
 
 
     if (killpg(job->pgid(), sig) < 0) {
     if (killpg(job->pgid(), sig) < 0) {
         if (kill(job->pid(), sig) < 0) {
         if (kill(job->pid(), sig) < 0) {
-            perror("kill");
+            if (errno != ESRCH)
+                perror("kill");
         }
         }
     }
     }
 }
 }