Skip to content

Commit 3778602

Browse files
committed
exclude the 4kB buffer when Process API is not available
1 parent bf20b67 commit 3778602

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/rcore.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4602,14 +4602,14 @@ RLAPI int WaitProcess(Process process)
46024602

46034603
RLAPI const char *ReadProcessOutput(Process process, int *length)
46044604
{
4605-
static char output[4096] = { 0 };
4606-
46074605
if (process.pid <= 0)
46084606
{
46094607
return NULL;
46104608
}
46114609

46124610
#if defined(_WIN32)
4611+
static char output[4096] = { 0 };
4612+
46134613
// Read from output pipe
46144614

46154615
// ReadFile will block if there is no data, so call PeekNamedPipe to check for data before reading
@@ -4631,6 +4631,8 @@ RLAPI const char *ReadProcessOutput(Process process, int *length)
46314631
*length = (int)bytesRead;
46324632
return output;
46334633
#elif defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
4634+
static char output[4096] = { 0 };
4635+
46344636
struct pollfd fds[1];
46354637
fds[0].fd = process.processData->pipefdStdout[0];
46364638
fds[0].events = POLLIN;

0 commit comments

Comments
 (0)