sbsv2/raptor/util/talon/talon.c
branchfix
changeset 237 dd11681bd6f3
parent 3 e1eecf4d390d
child 240 fbc6a8ad3957
child 251 64208ed747d4
equal deleted inserted replaced
236:a2dc04c8e649 237:dd11681bd6f3
    36 /* The output semaphore. */
    36 /* The output semaphore. */
    37 sbs_semaphore talon_sem;
    37 sbs_semaphore talon_sem;
    38 
    38 
    39 #define TALON_ATTEMPT_STRMAX 32
    39 #define TALON_ATTEMPT_STRMAX 32
    40 #define RECIPETAG_STRMAX 2048
    40 #define RECIPETAG_STRMAX 2048
    41 #define STATUS_STRMAX 100
    41 #define STATUS_STRMAX 120
    42 
    42 
    43 #define TALONDELIMITER '|'
    43 #define TALONDELIMITER '|'
    44 #define VARNAMEMAX 100
    44 #define VARNAMEMAX 100
    45 #define VARVALMAX 1024
    45 #define VARVALMAX 1024
    46 
    46 
   547 
   547 
   548 			talon_returncode = p->returncode;
   548 			talon_returncode = p->returncode;
   549 
   549 
   550 			if (dotagging) 
   550 			if (dotagging) 
   551 			{
   551 			{
   552 				char *forcesuccessstr = force_success == 0 ? "" : " forcesuccess='FORCESUCCESS'";
   552 				char *flagsstr = force_success == 0 ? "" : " flags='FORCESUCCESS'";
       
   553 				char *reasonstr = "" ;
       
   554 
       
   555 				if (p->causeofdeath == PROC_TIMEOUTDEATH)
       
   556 					reasonstr = " reason='timeout'";
   553 
   557 
   554 				if (p->returncode != 0)
   558 				if (p->returncode != 0)
   555 				{
   559 				{
   556 					char *exitstr = retries > 0 ? "retry" : "failed";
   560 					char *exitstr = retries > 0 ? "retry" : "failed";
   557 					snprintf(status, STATUS_STRMAX - 1, "\n<status exit='%s' code='%d' attempt='%d'%s />", exitstr, p->returncode, attempt, forcesuccessstr );
   561 					snprintf(status, STATUS_STRMAX - 1, "\n<status exit='%s' code='%d' attempt='%d'%s%s />", exitstr, p->returncode, attempt, flagsstr, reasonstr );
   558 				} else {
   562 				} else {
   559 					snprintf(status, STATUS_STRMAX - 1, "\n<status exit='ok' attempt='%d'%s />", attempt, forcesuccessstr );
   563 					snprintf(status, STATUS_STRMAX - 1, "\n<status exit='ok' attempt='%d'%s%s />", attempt, flagsstr, reasonstr );
   560 				}
   564 				}
   561 				status[STATUS_STRMAX-1] = '\0';
   565 				status[STATUS_STRMAX-1] = '\0';
   562 	
   566 	
   563 				snprintf(timestat, STATUS_STRMAX - 1, "<time start='%.5f' elapsed='%.3f' />",start_time, end_time-start_time );
   567 				snprintf(timestat, STATUS_STRMAX - 1, "<time start='%.5f' elapsed='%.3f' />",start_time, end_time-start_time );
   564 				timestat[STATUS_STRMAX-1] = '\0';
   568 				timestat[STATUS_STRMAX-1] = '\0';