From 562f38ab348b0b10f9844e9724ac6591a7d513b2 Mon Sep 17 00:00:00 2001 From: Oskari Alaranta Date: Mon, 31 Aug 2026 06:24:03 +0300 Subject: [PATCH] ProcessUNIX: Fix possible race condition --- Source/kwsys/ProcessUNIX.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/kwsys/ProcessUNIX.c b/Source/kwsys/ProcessUNIX.c index 8c22b4e43a..3f1e0fa2a2 100644 --- a/Source/kwsys/ProcessUNIX.c +++ b/Source/kwsys/ProcessUNIX.c @@ -1839,7 +1839,8 @@ static int kwsysProcessCreate(kwsysProcess* cp, int prIndex, /* Make sure the child is in the process group before we proceed. This avoids race conditions with calls to the kill function that we make for signalling process groups. */ - while ((readRes = read(pgidPipe[0], &tmp, 1)) > 0) { + while ((readRes = read(pgidPipe[0], &tmp, 1)) > 0 || + (readRes < 0 && errno == EINTR)) { } if (readRes < 0) { sigprocmask(SIG_SETMASK, &old_mask, 0); -- 2.55.0