Opening new buffer which is git show commit command
This commit is contained in:
@@ -421,11 +421,24 @@ StdoutPollInfo PollStdout(Process *process, char *buffer, int64_t buffer_size) {
|
||||
Assert(process->is_valid);
|
||||
Win32Process *p = (Win32Process *)process->platform;
|
||||
|
||||
DWORD bytes_read = 0;
|
||||
DWORD bytes_avail = 0;
|
||||
|
||||
bool peek_error = PeekNamedPipe(p->child_stdout_read, buffer, (DWORD)buffer_size, &bytes_read, &bytes_avail, NULL) == 0;
|
||||
StdoutPollInfo result = {};
|
||||
bool peek_error = PeekNamedPipe(p->child_stdout_read, NULL, 0, NULL, &bytes_avail, NULL) == 0;
|
||||
if (peek_error) {
|
||||
return result;
|
||||
}
|
||||
|
||||
StdoutPollInfo result = {bytes_read, bytes_avail};
|
||||
if (bytes_avail == 0) {
|
||||
return result;
|
||||
}
|
||||
|
||||
DWORD bytes_read = 0;
|
||||
bool read_error = ReadFile(p->child_stdout_read, buffer, (DWORD)buffer_size, &bytes_read, 0) == 0;
|
||||
if (read_error) {
|
||||
return result;
|
||||
}
|
||||
|
||||
result = {bytes_read, bytes_avail - bytes_read};
|
||||
return result;
|
||||
}
|
||||
Reference in New Issue
Block a user