]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
[EDF30662] : Avoid defunct process due to monitoring that can lead to #process limit... agy/30662
authorAnthony Geay <anthony.geay@edf.fr>
Fri, 2 Aug 2024 06:59:02 +0000 (08:59 +0200)
committerAnthony Geay <anthony.geay@edf.fr>
Fri, 2 Aug 2024 06:59:02 +0000 (08:59 +0200)
src/Basics/Monitoring.cxx

index a04e2c564720ca883b533965311146bb62b1ff5c..6eac06de5b42d0c44a65316264079f78ab64463b 100644 (file)
@@ -42,6 +42,8 @@
 #include <cstring>
 #include <sys/types.h>
 #include <signal.h>
+#include <sys/types.h>
+#include <sys/wait.h>
 #endif
 
 #ifndef WIN32
@@ -113,7 +115,9 @@ std::vector<double> SALOME::ReadFloatsInFile(const std::string& fileName)
 static void StopMonitoringLinux(long pid)
 {
   pid_t pid_of_subprocess = (pid_t) pid;
-  kill( pid_of_subprocess, SIGKILL );
+  kill( pid_of_subprocess, SIGTERM );
+  int wstatus;
+  waitpid( pid_of_subprocess, &wstatus , WUNTRACED);
 }
 #endif