Changeset a88ec8d69f922fad91f61239c8a7c84f915b825c

Show
Ignore:
Timestamp:
11/18/10 01:48:36 (3 years ago)
Author:
Nedko Arnaudov <nedko@…>
Children:
d027731b1848a3f06462a0aa71fd9e5926e14c9a
Parents:
fb15df6218dc5b759e5ba614d8413f1d1cda2d30
git-committer:
Nedko Arnaudov <nedko@arnaudov.name> / 2010-11-18T01:48:36Z+0200
Message:

ladishd: project_name -> vgraph_name (in loader module)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • daemon/loader.c

    r7d2ebaa ra88ec8d  
    4848  struct list_head  siblings; 
    4949 
    50   char * project_name; 
     50  char * vgraph_name; 
    5151  char * app_name; 
    5252 
     
    9494void 
    9595loader_check_line_repeat_end( 
    96   char * project, 
     96  char * vgraph_name, 
    9797  char * app_name, 
    9898  bool error, 
     
    103103    if (error) 
    104104    { 
    105       log_error_plain("%s:%s: stderr line repeated %u times", project, app_name, last_line_repeat_count); 
     105      log_error_plain("%s:%s: stderr line repeated %u times", vgraph_name, app_name, last_line_repeat_count); 
    106106    } 
    107107    else 
    108108    { 
    109       log_info("%s:%s: stdout line repeated %u times", project, app_name, last_line_repeat_count); 
     109      log_info("%s:%s: stdout line repeated %u times", vgraph_name, app_name, last_line_repeat_count); 
    110110    } 
    111111  } 
     
    125125    { 
    126126      loader_check_line_repeat_end( 
    127         child_ptr->project_name, 
     127        child_ptr->vgraph_name, 
    128128        child_ptr->app_name, 
    129129        false, 
     
    131131 
    132132      loader_check_line_repeat_end( 
    133         child_ptr->project_name, 
     133        child_ptr->vgraph_name, 
    134134        child_ptr->app_name, 
    135135        true, 
     
    140140      list_del(&child_ptr->siblings); 
    141141 
    142       free(child_ptr->project_name); 
     142      free(child_ptr->vgraph_name); 
    143143      free(child_ptr->app_name); 
    144144 
     
    312312void 
    313313loader_read_child_output( 
    314   char * project, 
     314  char * vgraph_name, 
    315315  char * app_name, 
    316316  int fd, 
     
    346346            if (error) 
    347347            { 
    348               log_error_plain("%s:%s: last stderr line repeating..", project, app_name); 
     348              log_error_plain("%s:%s: last stderr line repeating..", vgraph_name, app_name); 
    349349            } 
    350350            else 
    351351            { 
    352               log_info("%s:%s: last stdout line repeating...", project, app_name); 
     352              log_info("%s:%s: last stdout line repeating...", vgraph_name, app_name); 
    353353            } 
    354354          } 
     
    358358        else 
    359359        { 
    360           loader_check_line_repeat_end(project, app_name, error, *last_line_repeat_count); 
     360          loader_check_line_repeat_end(vgraph_name, app_name, error, *last_line_repeat_count); 
    361361 
    362362          strcpy(last_line, char_ptr); 
     
    365365          if (error) 
    366366          { 
    367             log_error_plain("%s:%s: %s", project, app_name, char_ptr); 
     367            log_error_plain("%s:%s: %s", vgraph_name, app_name, char_ptr); 
    368368          } 
    369369          else 
    370370          { 
    371             log_info("%s:%s: %s", project, app_name, char_ptr); 
     371            log_info("%s:%s: %s", vgraph_name, app_name, char_ptr); 
    372372          } 
    373373        } 
     
    388388          if (error) 
    389389          { 
    390             log_error_plain("%s:%s: %s " ANSI_RESET ANSI_COLOR_RED "(truncated) " ANSI_RESET, project, app_name, char_ptr); 
     390            log_error_plain("%s:%s: %s " ANSI_RESET ANSI_COLOR_RED "(truncated) " ANSI_RESET, vgraph_name, app_name, char_ptr); 
    391391          } 
    392392          else 
    393393          { 
    394             log_info("%s:%s: %s " ANSI_RESET ANSI_COLOR_RED "(truncated) " ANSI_RESET, project, app_name, char_ptr); 
     394            log_info("%s:%s: %s " ANSI_RESET ANSI_COLOR_RED "(truncated) " ANSI_RESET, vgraph_name, app_name, char_ptr); 
    395395          } 
    396396 
     
    422422    { 
    423423      loader_read_child_output( 
    424         child_ptr->project_name, 
     424        child_ptr->vgraph_name, 
    425425        child_ptr->app_name, 
    426426        child_ptr->stdout, 
     
    432432 
    433433      loader_read_child_output( 
    434         child_ptr->project_name, 
     434        child_ptr->vgraph_name, 
    435435        child_ptr->app_name, 
    436436        child_ptr->stderr, 
     
    453453bool 
    454454loader_execute( 
    455   const char * project_name, 
     455  const char * vgraph_name, 
    456456  const char * app_name, 
    457457  const char * working_dir, 
     
    471471  } 
    472472 
    473   child_ptr->project_name = strdup(project_name); 
    474   if (child_ptr->project_name == NULL) 
    475   { 
    476     log_error("strdup() failed to duplicate project name '%s'", project_name); 
     473  child_ptr->vgraph_name = strdup(vgraph_name); 
     474  if (child_ptr->vgraph_name == NULL) 
     475  { 
     476    log_error("strdup() failed to duplicate vgraph name '%s'", vgraph_name); 
    477477    goto free_struct; 
    478478  } 
     
    482482  { 
    483483    log_error("strdup() failed to duplicate app name '%s'", app_name); 
    484     goto free_project_name; 
     484    goto free_vgraph_name; 
    485485  } 
    486486 
     
    527527  if (pid == -1) 
    528528  { 
    529     log_error("Could not fork to exec program %s:%s: %s", project_name, app_name, strerror(errno)); 
     529    log_error("Could not fork to exec program %s:%s: %s", vgraph_name, app_name, strerror(errno)); 
    530530    list_del(&child_ptr->siblings); /* fork failed so it is not really a child process to watch for. */ 
    531531    return false; 
     
    574574  } 
    575575 
    576   log_info("Forked to run program %s:%s pid = %llu", project_name, app_name, (unsigned long long)pid); 
     576  log_info("Forked to run program %s:%s pid = %llu", vgraph_name, app_name, (unsigned long long)pid); 
    577577 
    578578  *pid_ptr = child_ptr->pid = pid; 
     
    580580  return true; 
    581581 
    582 free_project_name: 
    583   free(child_ptr->project_name); 
     582free_vgraph_name: 
     583  free(child_ptr->vgraph_name); 
    584584 
    585585free_struct: