mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-05 22:30:29 +00:00
Merge f53f9e9945 into dc8b189491
This commit is contained in:
commit
05ed764cd1
1 changed files with 16 additions and 4 deletions
|
|
@ -457,8 +457,8 @@ static int process_testStdinToStdout(void *arg)
|
|||
|
||||
total_written = 0;
|
||||
total_read = 0;
|
||||
for (;;) {
|
||||
int log_this_iteration = (iteration_count % 32) == 32;
|
||||
for (iteration_count = 0; true; iteration_count++) {
|
||||
bool log_this_iteration = true;
|
||||
char local_buffer[16 * 4094];
|
||||
size_t amount_read;
|
||||
SDL_IOStatus io_status;
|
||||
|
|
@ -469,7 +469,10 @@ static int process_testStdinToStdout(void *arg)
|
|||
}
|
||||
amount_written = SDL_WriteIO(process_stdin, text_in + total_written, text_in_size - total_written);
|
||||
if (log_this_iteration) {
|
||||
SDLTest_Log("SDL_WriteIO() -> %u (%dth time)", (unsigned)amount_written, iteration_count);
|
||||
SDLTest_Log("SDL_WriteIO() -> %u (%dth time), total written %u",
|
||||
(unsigned)amount_written,
|
||||
iteration_count,
|
||||
(unsigned)(total_written + amount_written));
|
||||
}
|
||||
if (amount_written == 0) {
|
||||
io_status = SDL_GetIOStatus(process_stdin);
|
||||
|
|
@ -480,6 +483,12 @@ static int process_testStdinToStdout(void *arg)
|
|||
}
|
||||
total_written += amount_written;
|
||||
SDL_FlushIO(process_stdin);
|
||||
if (total_written == text_in_size) {
|
||||
SDLTest_Log("All data written to stdin");
|
||||
}
|
||||
else if (total_written > text_in_size) {
|
||||
SDLTest_Log("Too much data written?!");
|
||||
}
|
||||
}
|
||||
|
||||
/* FIXME: this needs a rate limit */
|
||||
|
|
@ -488,7 +497,10 @@ static int process_testStdinToStdout(void *arg)
|
|||
}
|
||||
amount_read = SDL_ReadIO(process_stdout, local_buffer, sizeof(local_buffer));
|
||||
if (log_this_iteration) {
|
||||
SDLTest_Log("SDL_ReadIO() -> %u (%dth time)", (unsigned)amount_read, iteration_count);
|
||||
SDLTest_Log("SDL_ReadIO() -> %u (%dth time), total read %u",
|
||||
(unsigned)amount_read,
|
||||
iteration_count,
|
||||
(unsigned)(total_read + amount_read));
|
||||
}
|
||||
if (amount_read == 0) {
|
||||
io_status = SDL_GetIOStatus(process_stdout);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue