summaryrefslogtreecommitdiff
path: root/lib/igt_core.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/igt_core.c')
-rw-r--r--lib/igt_core.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/igt_core.c b/lib/igt_core.c
index 950ea9b0..538a4472 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -2282,6 +2282,13 @@ int igt_system(const char *command)
if (pipe(errpipe) < 0)
goto err;
+ /*
+ * The clone() system call called from a largish executable has
+ * difficulty to make progress if interrupted too frequently, so
+ * suspend the signal helper for the time of the syscall.
+ */
+ igt_suspend_signal_helper();
+
igt_fork_helper(&process) {
close(outpipe[0]);
close(errpipe[0]);
@@ -2298,6 +2305,8 @@ int igt_system(const char *command)
exit(EXIT_FAILURE);
}
+ igt_resume_signal_helper();
+
close(outpipe[1]);
close(errpipe[1]);
@@ -2340,9 +2349,14 @@ int igt_system_quiet(const char *command)
if (dup2(nullfd, STDERR_FILENO) == -1)
goto err;
+ /* See igt_system() for the reason for suspending the signal helper. */
+ igt_suspend_signal_helper();
+
if ((status = system(command)) == -1)
goto err;
+ igt_resume_signal_helper();
+
/* restore */
if (dup2(stdout_fd_copy, STDOUT_FILENO) == -1)
goto err;
@@ -2355,6 +2369,8 @@ int igt_system_quiet(const char *command)
return WEXITSTATUS(status);
err:
+ igt_resume_signal_helper();
+
close(stderr_fd_copy);
close(stdout_fd_copy);
close(nullfd);