mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-06 21:55:43 +01:00
system-exec read: allow 1 byte for null termination -- #7715
This commit is contained in:
parent
145d7f8d0a
commit
87602e7fb3
1 changed files with 2 additions and 2 deletions
|
|
@ -613,7 +613,7 @@ SystemExec::output_interposer()
|
|||
if (bytesAvail < 1) {Sleep(500); printf("N/A\n"); continue;}
|
||||
#endif
|
||||
if (stdoutP[0] == INVALID_HANDLE_VALUE) break;
|
||||
if (!ReadFile(stdoutP[0], data, BUFSIZ, &bytesRead, 0)) {
|
||||
if (!ReadFile(stdoutP[0], data, BUFSIZ - 1, &bytesRead, 0)) {
|
||||
DWORD err = GetLastError();
|
||||
if (err == ERROR_IO_PENDING) continue;
|
||||
break;
|
||||
|
|
@ -964,7 +964,7 @@ SystemExec::output_interposer()
|
|||
ioctl(rfd, FIONBIO, &l); // set non-blocking I/O
|
||||
|
||||
for (;fcntl(rfd, F_GETFL)!=-1;) {
|
||||
r = read(rfd, buf, sizeof(buf));
|
||||
r = read(rfd, buf, BUFSIZ - 1);
|
||||
if (r < 0 && (errno == EINTR || errno == EAGAIN)) {
|
||||
fd_set rfds;
|
||||
struct timeval tv;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue