Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Kill the MSG_paje_output() function. It's a noop since 2 years
[simgrid.git] / tools / tesh2 / src / writer.c
index bb9b445340735805543ae93acbcdf45f6361f4d7..3755abc822143226ff14d155a269ec348da671b8 100644 (file)
@@ -74,6 +74,8 @@ writer_start_routine(void* p)
        DWORD number_of_bytes_to_write = command->context->input->used;\r
        DWORD number_of_bytes_written = 0;\r
 \r
+       xbt_os_sem_release(writer->written);\r
+\r
        while(!command->failed && !command->interrupted && !command->successeded && ! writer->failed && ! writer->broken_pipe && number_of_bytes_to_write)\r
        {\r
                if(!WriteFile(writer->command->stdin_fd, input, number_of_bytes_to_write, &number_of_bytes_written, NULL))\r
@@ -97,7 +99,7 @@ writer_start_routine(void* p)
        if(writer->failed  && !command->successeded && !command->failed && !command->interrupted)\r
        {\r
                ERROR2("[%s] Error while writing input to child `%s'", command->context->pos, command->context->command_line);\r
-               unit_set_error(command->unit, (int)GetLastError(), 0);\r
+               unit_set_error(command->unit, (int)GetLastError(), 0, command->context->pos);\r
                command_handle_failure(command, csr_write_failure);\r
        }\r
        /*else if(writer->broken_pipe && !command->successeded && !command->failed && !command->interrupted)\r
@@ -108,7 +110,7 @@ writer_start_routine(void* p)
                command_kill(command);\r
                command_handle_failure(command, csr_write_pipe_broken);\r
        }*/\r
-       \r
+\r
        CloseHandle(command->stdin_fd);\r
        command->stdin_fd = INDEFINITE_FD;\r
 \r
@@ -186,14 +188,14 @@ writer_start_routine(void* p)
                command_kill(command);\r
                ERROR2("[%s] Error while writing input to child `%s'", command->context->pos, command->context->command_line);\r
                \r
-               unit_set_error(command->unit, errno, 0);\r
+               unit_set_error(command->unit, errno, 0, command->context->pos);\r
                command_handle_failure(command, csr_write_failure);\r
        }\r
        else if(writer->broken_pipe && !command->successeded && !command->failed && !command->interrupted)\r
        {\r
                ERROR2("[%s] Pipe broken while writing input to child `%s'", command->context->pos, command->context->command_line);\r
 \r
-               unit_set_error(command->unit, errno, 0);\r
+               unit_set_error(command->unit, errno, 0, command->context->pos);\r
                command_kill(command);\r
                command_handle_failure(command, csr_write_pipe_broken);\r
        }\r