diff --git a/OpenFilesScreen.c b/OpenFilesScreen.c index 34367ebc..2d191692 100644 --- a/OpenFilesScreen.c +++ b/OpenFilesScreen.c @@ -9,6 +9,7 @@ in the source distribution for its full text. #include "OpenFilesScreen.h" +#include #include #include #include @@ -197,10 +198,11 @@ static OpenFiles_ProcessData* OpenFilesScreen_getProcessData(pid_t pid) { fclose(fd); int wstatus; - if (waitpid(child, &wstatus, 0) == -1) { - pdata->error = 1; - return pdata; - } + while (waitpid(child, &wstatus, 0) == -1) + if (errno != EINTR) { + pdata->error = 1; + return pdata; + } if (!WIFEXITED(wstatus)) { pdata->error = 1; diff --git a/TraceScreen.c b/TraceScreen.c index c726394a..c3a94492 100644 --- a/TraceScreen.c +++ b/TraceScreen.c @@ -10,6 +10,7 @@ in the source distribution for its full text. #include "TraceScreen.h" #include +#include #include #include #include @@ -47,7 +48,9 @@ void TraceScreen_delete(Object* cast) { TraceScreen* this = (TraceScreen*) cast; if (this->child > 0) { kill(this->child, SIGTERM); - waitpid(this->child, NULL, 0); + while (waitpid(this->child, NULL, 0) == -1) + if (errno != EINTR) + break; } if (this->strace) {