2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-21 02:52:12 +00:00

Add partial code for indicating to the output function that a command finished because of a timeout.

[SVN r39416]
This commit is contained in:
Rene Rivera
2007-09-20 16:31:44 +00:00
parent cba8401523
commit 36e3b43722
5 changed files with 19 additions and 6 deletions

View File

@@ -129,11 +129,13 @@ static struct
string buffer_err;
/* running process info */
PROCESS_INFORMATION pi;
/* when comand complates, the result value */
/* when comand completes, the result value */
DWORD exitcode;
/* function called when the command completes */
void (*func)( void *closure, int status, timing_info*, char *, char * );
void *closure;
/* when command completes, the reason it completed */
int exit_reason;
} cmdtab[ MAXJOBS ] = {{0}};
/* execution unit tests */
@@ -518,7 +520,8 @@ int execwait()
cmdtab[i].target.size > 0 ? cmdtab[i].target.value : 0,
cmdtab[i].command.size > 0 ? cmdtab[i].command.value : 0,
cmdtab[i].buffer_out.size > 0 ? cmdtab[i].buffer_out.value : 0,
cmdtab[i].buffer_err.size > 0 ? cmdtab[i].buffer_err.value : 0);
cmdtab[i].buffer_err.size > 0 ? cmdtab[i].buffer_err.value : 0,
cmdtab[i].exit_reason);
/* call the callback, may call back to jam rule land.
assume -p0 in effect so only pass buffer containing
@@ -542,6 +545,7 @@ int execwait()
string_free(&cmdtab[i].buffer_out); string_new(&cmdtab[i].buffer_out);
string_free(&cmdtab[i].buffer_err); string_new(&cmdtab[i].buffer_err);
cmdtab[i].exitcode = 0;
cmdtab[i].exit_reason = EXIT_OK;
}
return 1;
@@ -915,6 +919,8 @@ static int try_kill_one()
kill_process_tree(0,cmdtab[i].pi.hProcess);
/* and return it as complete, with the failure code */
GetExitCodeProcess( cmdtab[i].pi.hProcess, &cmdtab[i].exitcode );
/* mark it as a timeout */
cmdtab[i].exit_reason = EXIT_TIMEOUT;
return i;
}
}

View File

@@ -473,7 +473,8 @@ execwait()
/* print out the rule and target name */
out_action(cmdtab[i].action, cmdtab[i].target,
cmdtab[i].command, cmdtab[i].buffer[OUT], cmdtab[i].buffer[ERR]);
cmdtab[i].command, cmdtab[i].buffer[OUT], cmdtab[i].buffer[ERR],
EXIT_OK);
times(&new_time);

View File

@@ -513,7 +513,7 @@ make1c( state *pState )
target = lol_get(&cmd->args, 0)->string;
if ( globs.noexec )
{
out_action(rule_name,target,cmd->buf,"","");
out_action(rule_name,target,cmd->buf,"","",EXIT_OK);
}
}

View File

@@ -30,7 +30,8 @@ void out_action(
const char * target,
const char * command,
const char * out_data,
const char * err_data
const char * err_data,
int exit_reason
)
{
/* print out the action+target line, if the action is quite

View File

@@ -7,12 +7,17 @@
#ifndef BJAM_OUTPUT_H
#define BJAM_OUTPUT_H
#define EXIT_OK 0
#define EXIT_FAIL 1
#define EXIT_TIMEOUT 2
void out_action(
const char * action,
const char * target,
const char * command,
const char * out_data,
const char * err_data
const char * err_data,
int exit_reason
);
#endif