ladishd: project_name -> vgraph_name (in loader module)

This commit is contained in:
Nedko Arnaudov 2010-11-18 01:48:36 +02:00
parent fb15df6218
commit a88ec8d69f
1 changed files with 26 additions and 26 deletions

View File

@ -47,7 +47,7 @@ struct loader_child
{ {
struct list_head siblings; struct list_head siblings;
char * project_name; char * vgraph_name;
char * app_name; char * app_name;
bool dead; bool dead;
@ -93,7 +93,7 @@ loader_child_find_and_mark_dead(pid_t pid)
static static
void void
loader_check_line_repeat_end( loader_check_line_repeat_end(
char * project, char * vgraph_name,
char * app_name, char * app_name,
bool error, bool error,
unsigned int last_line_repeat_count) unsigned int last_line_repeat_count)
@ -102,11 +102,11 @@ loader_check_line_repeat_end(
{ {
if (error) if (error)
{ {
log_error_plain("%s:%s: stderr line repeated %u times", project, app_name, last_line_repeat_count); log_error_plain("%s:%s: stderr line repeated %u times", vgraph_name, app_name, last_line_repeat_count);
} }
else else
{ {
log_info("%s:%s: stdout line repeated %u times", project, app_name, last_line_repeat_count); log_info("%s:%s: stdout line repeated %u times", vgraph_name, app_name, last_line_repeat_count);
} }
} }
} }
@ -124,13 +124,13 @@ loader_childs_bury(void)
if (child_ptr->dead) if (child_ptr->dead)
{ {
loader_check_line_repeat_end( loader_check_line_repeat_end(
child_ptr->project_name, child_ptr->vgraph_name,
child_ptr->app_name, child_ptr->app_name,
false, false,
child_ptr->stdout_last_line_repeat_count); child_ptr->stdout_last_line_repeat_count);
loader_check_line_repeat_end( loader_check_line_repeat_end(
child_ptr->project_name, child_ptr->vgraph_name,
child_ptr->app_name, child_ptr->app_name,
true, true,
child_ptr->stderr_last_line_repeat_count); child_ptr->stderr_last_line_repeat_count);
@ -139,7 +139,7 @@ loader_childs_bury(void)
list_del(&child_ptr->siblings); list_del(&child_ptr->siblings);
free(child_ptr->project_name); free(child_ptr->vgraph_name);
free(child_ptr->app_name); free(child_ptr->app_name);
if (!child_ptr->terminal) if (!child_ptr->terminal)
@ -311,7 +311,7 @@ static void loader_exec_program(const char * commandline, const char * working_d
static static
void void
loader_read_child_output( loader_read_child_output(
char * project, char * vgraph_name,
char * app_name, char * app_name,
int fd, int fd,
bool error, bool error,
@ -345,11 +345,11 @@ loader_read_child_output(
{ {
if (error) if (error)
{ {
log_error_plain("%s:%s: last stderr line repeating..", project, app_name); log_error_plain("%s:%s: last stderr line repeating..", vgraph_name, app_name);
} }
else else
{ {
log_info("%s:%s: last stdout line repeating...", project, app_name); log_info("%s:%s: last stdout line repeating...", vgraph_name, app_name);
} }
} }
@ -357,18 +357,18 @@ loader_read_child_output(
} }
else else
{ {
loader_check_line_repeat_end(project, app_name, error, *last_line_repeat_count); loader_check_line_repeat_end(vgraph_name, app_name, error, *last_line_repeat_count);
strcpy(last_line, char_ptr); strcpy(last_line, char_ptr);
*last_line_repeat_count = 1; *last_line_repeat_count = 1;
if (error) if (error)
{ {
log_error_plain("%s:%s: %s", project, app_name, char_ptr); log_error_plain("%s:%s: %s", vgraph_name, app_name, char_ptr);
} }
else else
{ {
log_info("%s:%s: %s", project, app_name, char_ptr); log_info("%s:%s: %s", vgraph_name, app_name, char_ptr);
} }
} }
@ -387,11 +387,11 @@ loader_read_child_output(
if (error) if (error)
{ {
log_error_plain("%s:%s: %s " ANSI_RESET ANSI_COLOR_RED "(truncated) " ANSI_RESET, project, app_name, char_ptr); log_error_plain("%s:%s: %s " ANSI_RESET ANSI_COLOR_RED "(truncated) " ANSI_RESET, vgraph_name, app_name, char_ptr);
} }
else else
{ {
log_info("%s:%s: %s " ANSI_RESET ANSI_COLOR_RED "(truncated) " ANSI_RESET, project, app_name, char_ptr); log_info("%s:%s: %s " ANSI_RESET ANSI_COLOR_RED "(truncated) " ANSI_RESET, vgraph_name, app_name, char_ptr);
} }
left = 0; left = 0;
@ -421,7 +421,7 @@ loader_read_childs_output(void)
if (!child_ptr->dead && !child_ptr->terminal) if (!child_ptr->dead && !child_ptr->terminal)
{ {
loader_read_child_output( loader_read_child_output(
child_ptr->project_name, child_ptr->vgraph_name,
child_ptr->app_name, child_ptr->app_name,
child_ptr->stdout, child_ptr->stdout,
false, false,
@ -431,7 +431,7 @@ loader_read_childs_output(void)
&child_ptr->stdout_last_line_repeat_count); &child_ptr->stdout_last_line_repeat_count);
loader_read_child_output( loader_read_child_output(
child_ptr->project_name, child_ptr->vgraph_name,
child_ptr->app_name, child_ptr->app_name,
child_ptr->stderr, child_ptr->stderr,
true, true,
@ -452,7 +452,7 @@ loader_run(void)
bool bool
loader_execute( loader_execute(
const char * project_name, const char * vgraph_name,
const char * app_name, const char * app_name,
const char * working_dir, const char * working_dir,
bool run_in_terminal, bool run_in_terminal,
@ -470,10 +470,10 @@ loader_execute(
goto fail; goto fail;
} }
child_ptr->project_name = strdup(project_name); child_ptr->vgraph_name = strdup(vgraph_name);
if (child_ptr->project_name == NULL) if (child_ptr->vgraph_name == NULL)
{ {
log_error("strdup() failed to duplicate project name '%s'", project_name); log_error("strdup() failed to duplicate vgraph name '%s'", vgraph_name);
goto free_struct; goto free_struct;
} }
@ -481,7 +481,7 @@ loader_execute(
if (child_ptr->app_name == NULL) if (child_ptr->app_name == NULL)
{ {
log_error("strdup() failed to duplicate app name '%s'", app_name); log_error("strdup() failed to duplicate app name '%s'", app_name);
goto free_project_name; goto free_vgraph_name;
} }
child_ptr->dead = false; child_ptr->dead = false;
@ -526,7 +526,7 @@ loader_execute(
if (pid == -1) if (pid == -1)
{ {
log_error("Could not fork to exec program %s:%s: %s", project_name, app_name, strerror(errno)); log_error("Could not fork to exec program %s:%s: %s", vgraph_name, app_name, strerror(errno));
list_del(&child_ptr->siblings); /* fork failed so it is not really a child process to watch for. */ list_del(&child_ptr->siblings); /* fork failed so it is not really a child process to watch for. */
return false; return false;
} }
@ -573,14 +573,14 @@ loader_execute(
} }
} }
log_info("Forked to run program %s:%s pid = %llu", project_name, app_name, (unsigned long long)pid); log_info("Forked to run program %s:%s pid = %llu", vgraph_name, app_name, (unsigned long long)pid);
*pid_ptr = child_ptr->pid = pid; *pid_ptr = child_ptr->pid = pid;
return true; return true;
free_project_name: free_vgraph_name:
free(child_ptr->project_name); free(child_ptr->vgraph_name);
free_struct: free_struct:
free(child_ptr); free(child_ptr);