summaryrefslogtreecommitdiffstats
path: root/source/core
diff options
context:
space:
mode:
Diffstat (limited to 'source/core')
-rw-r--r--source/core/unix/slang-unix-process-util.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/source/core/unix/slang-unix-process-util.cpp b/source/core/unix/slang-unix-process-util.cpp
index ab4366b06..ec5d4865a 100644
--- a/source/core/unix/slang-unix-process-util.cpp
+++ b/source/core/unix/slang-unix-process-util.cpp
@@ -106,14 +106,23 @@ namespace Slang {
int stderrPipe[2];
if (pipe(stdoutPipe) == -1)
+ {
+ fprintf(stderr, "error: `pipe` failed\n");
return SLANG_FAIL;
+ }
if (pipe(stderrPipe) == -1)
+ {
+ fprintf(stderr, "error: `pipe` failed\n");
return SLANG_FAIL;
+ }
pid_t childProcessID = fork();
if (childProcessID == -1)
+ {
+ fprintf(stderr, "error: `fork` failed\n");
return SLANG_FAIL;
+ }
if (childProcessID == 0)
{
@@ -166,9 +175,9 @@ namespace Slang {
return SLANG_FAIL;
}
- // Set a timeout of ten seconds;
+ // Set a timeout of twenty seconds;
// we really shouldn't wait too long...
- int pollTimeout = 10000;
+ int pollTimeout = 20000;
int pollResult = poll(pollInfos, pollInfoCount, pollTimeout);
if (pollResult <= 0)
{
@@ -178,6 +187,7 @@ namespace Slang {
continue;
// timeout or error...
+ fprintf(stderr, "error: `poll` failed or timed out\n");
return SLANG_FAIL;
}
@@ -228,6 +238,7 @@ namespace Slang {
pid_t terminatedProcessID = waitpid(childProcessID, &childStatus, 0);
if (terminatedProcessID == -1)
{
+ fprintf(stderr, "error: `waitpid` failed\n");
return SLANG_FAIL;
}