Skip to content

Commit e13d6ac

Browse files
authored
Merge pull request #241 from Atari2/master
Fix asar-exe-test deadlock because write pipe is full
2 parents 6275af4 + f8969e0 commit e13d6ac

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/asar-tests/test.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,10 @@ static bool execute_command_line(char * commandline, const char * stdout_log_fil
261261
sa.bInheritHandle = TRUE;
262262
sa.lpSecurityDescriptor = nullptr;
263263

264-
if (!CreatePipe(&stdout_read_handle, &stdout_write_handle, &sa, 0))
264+
SYSTEM_INFO sInfo{};
265+
GetSystemInfo(&sInfo);
266+
267+
if (!CreatePipe(&stdout_read_handle, &stdout_write_handle, &sa, sInfo.dwPageSize * 4))
265268
{
266269
return false;
267270
}
@@ -273,7 +276,7 @@ static bool execute_command_line(char * commandline, const char * stdout_log_fil
273276
return false;
274277
}
275278

276-
if (!CreatePipe(&stderr_read_handle, &stderr_write_handle, &sa, 0))
279+
if (!CreatePipe(&stderr_read_handle, &stderr_write_handle, &sa, sInfo.dwPageSize * 4))
277280
{
278281
CloseHandle(stdout_read_handle);
279282
CloseHandle(stdout_write_handle);

0 commit comments

Comments
 (0)