Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Java lang with cmake.
[simgrid.git] / tools / tesh2 / src / main.c
index c171590..44293c8 100644 (file)
@@ -182,6 +182,9 @@ exit_code = 0;
 int
 err_kind = 0;
 
+char* 
+err_line = NULL;
+
 
 pid_t
 pid =0;
@@ -610,13 +613,22 @@ finalize(void)
 
        if(sig_int)
                INFO0("Tesh interrupted (receive a SIGINT)");
-       else if(!summary_flag && !dry_run_flag && !silent_flag && !just_print_flag && !print_version_flag && !print_usage_flag && is_tesh_root)
+       else if(!summary_flag && !detail_summary_flag && !dry_run_flag && !silent_flag && !just_print_flag && !print_version_flag && !print_usage_flag && is_tesh_root)
        {
                if(!exit_code)
                        INFO2("Tesh terminated with exit code %d : %s",exit_code, "success");
                else
-                       ERROR2("Tesh terminated with exit code `(%s)' (%d)",error_to_string(exit_code, err_kind), exit_code);
+               {
+                       if(err_line)
+                               ERROR3("Tesh terminated with exit code `(<%s> %s)' (%d)",err_line, error_to_string(exit_code, err_kind), exit_code);
+                       else
+                               ERROR2("Tesh terminated with exit code `(%s)' (%d)", error_to_string(exit_code, err_kind), exit_code);
+                       
+               }
        }
+
+       if(err_line)
+               free(err_line);
        
        /* exit from the xbt framework */
        xbt_exit();
@@ -961,7 +973,7 @@ process_command_line(int argc, char** argv)
                                                                if(ENOENT == errno)
                                                                        ERROR1("File %s does not exist", optarg);
                                                                else
-                                                                       ERROR0("Insufficient memory is available to process the command line - system error");
+                                                                       ERROR1("System error :`(%s)'", strerror(errno));
                                                                
                                                                return -1;
                                                        }