Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
last modification of the tesh2 files (variable extend and some corrections)
[simgrid.git] / tools / tesh2 / src / reader.c
index b3fcb1b..ddff421 100644 (file)
@@ -79,6 +79,8 @@ reader_start_routine(void* p)
        char* clean = (char*)calloc(number_of_bytes_to_read + 1,sizeof(char));\r
        size_t i, j;\r
 \r
+       xbt_os_sem_release(reader->started);\r
+\r
        while(!command->failed && !command->interrupted && !command->successeded && !reader->failed && !reader->broken_pipe)\r
        {\r
                if(!ReadFile(stdout_fd, buffer, number_of_bytes_to_read, &number_of_bytes_readed, NULL) || (0 == number_of_bytes_readed))\r
@@ -94,7 +96,7 @@ reader_start_routine(void* p)
                        if(number_of_bytes_readed > 0) \r
                        {\r
                                for(i= 0, j= 0; i < number_of_bytes_readed; i++)\r
-                                       if((int)(buffer[i]) != 13)\r
+                                       if((buffer[i]) != '\r')\r
                                                clean[j++] = buffer[i];\r
 \r
                                xbt_strbuff_append(output,clean);\r
@@ -150,7 +152,7 @@ reader_start_routine(void* p)
                else\r
                        INFO1("[%s] No output before read failure",command->context->pos);\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_read_failure);\r
        }\r
@@ -245,7 +247,7 @@ reader_start_routine(void* p)
                else\r
                        INFO1("[%s] No output before read failure",command->context->pos);\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_read_failure);\r
        }\r