forked from puppylinux-woof-CE/woof-CE
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
From 7381bffb118436535349134ff96c240b4d68c324 Mon Sep 17 00:00:00 2001 | ||
From: Dima Krasner <dima@dimakrasner.com> | ||
Date: Mon, 27 Jun 2022 06:46:44 +0000 | ||
Subject: [PATCH] Retry select() on dynamic menu pipe if interrupted by SIGCHLD | ||
|
||
--- | ||
src/command.c | 5 ++++- | ||
1 file changed, 4 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/src/command.c b/src/command.c | ||
index 9f21922..02e49c5 100644 | ||
--- a/src/command.c | ||
+++ b/src/command.c | ||
@@ -15,6 +15,7 @@ | ||
#include "timing.h" | ||
|
||
#include <fcntl.h> | ||
+#include <errno.h> | ||
|
||
/** Structure to represent a list of commands. */ | ||
typedef struct CommandNode { | ||
@@ -202,7 +203,9 @@ char *ReadFromProcess(const char *command, unsigned timeout_ms) | ||
tv.tv_usec = (diff_ms % 1000) * 1000; | ||
|
||
/* Wait for data (or a timeout). */ | ||
- rc = select(fds[0] + 1, &fs, NULL, &fs, &tv); | ||
+ do { | ||
+ rc = select(fds[0] + 1, &fs, NULL, &fs, &tv); | ||
+ } while(rc < 0 && errno == EINTR); | ||
if(rc == 0) { | ||
close(fds[0]); | ||
/* Timeout */ | ||
-- | ||
2.34.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters