Changeset a88ec8d69f922fad91f61239c8a7c84f915b825c
- 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:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r7d2ebaa
|
ra88ec8d
|
|
| 48 | 48 | struct list_head siblings; |
| 49 | 49 | |
| 50 | | char * project_name; |
| | 50 | char * vgraph_name; |
| 51 | 51 | char * app_name; |
| 52 | 52 | |
| … |
… |
|
| 94 | 94 | void |
| 95 | 95 | loader_check_line_repeat_end( |
| 96 | | char * project, |
| | 96 | char * vgraph_name, |
| 97 | 97 | char * app_name, |
| 98 | 98 | bool error, |
| … |
… |
|
| 103 | 103 | if (error) |
| 104 | 104 | { |
| 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); |
| 106 | 106 | } |
| 107 | 107 | else |
| 108 | 108 | { |
| 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); |
| 110 | 110 | } |
| 111 | 111 | } |
| … |
… |
|
| 125 | 125 | { |
| 126 | 126 | loader_check_line_repeat_end( |
| 127 | | child_ptr->project_name, |
| | 127 | child_ptr->vgraph_name, |
| 128 | 128 | child_ptr->app_name, |
| 129 | 129 | false, |
| … |
… |
|
| 131 | 131 | |
| 132 | 132 | loader_check_line_repeat_end( |
| 133 | | child_ptr->project_name, |
| | 133 | child_ptr->vgraph_name, |
| 134 | 134 | child_ptr->app_name, |
| 135 | 135 | true, |
| … |
… |
|
| 140 | 140 | list_del(&child_ptr->siblings); |
| 141 | 141 | |
| 142 | | free(child_ptr->project_name); |
| | 142 | free(child_ptr->vgraph_name); |
| 143 | 143 | free(child_ptr->app_name); |
| 144 | 144 | |
| … |
… |
|
| 312 | 312 | void |
| 313 | 313 | loader_read_child_output( |
| 314 | | char * project, |
| | 314 | char * vgraph_name, |
| 315 | 315 | char * app_name, |
| 316 | 316 | int fd, |
| … |
… |
|
| 346 | 346 | if (error) |
| 347 | 347 | { |
| 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); |
| 349 | 349 | } |
| 350 | 350 | else |
| 351 | 351 | { |
| 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); |
| 353 | 353 | } |
| 354 | 354 | } |
| … |
… |
|
| 358 | 358 | else |
| 359 | 359 | { |
| 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); |
| 361 | 361 | |
| 362 | 362 | strcpy(last_line, char_ptr); |
| … |
… |
|
| 365 | 365 | if (error) |
| 366 | 366 | { |
| 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); |
| 368 | 368 | } |
| 369 | 369 | else |
| 370 | 370 | { |
| 371 | | log_info("%s:%s: %s", project, app_name, char_ptr); |
| | 371 | log_info("%s:%s: %s", vgraph_name, app_name, char_ptr); |
| 372 | 372 | } |
| 373 | 373 | } |
| … |
… |
|
| 388 | 388 | if (error) |
| 389 | 389 | { |
| 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); |
| 391 | 391 | } |
| 392 | 392 | else |
| 393 | 393 | { |
| 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); |
| 395 | 395 | } |
| 396 | 396 | |
| … |
… |
|
| 422 | 422 | { |
| 423 | 423 | loader_read_child_output( |
| 424 | | child_ptr->project_name, |
| | 424 | child_ptr->vgraph_name, |
| 425 | 425 | child_ptr->app_name, |
| 426 | 426 | child_ptr->stdout, |
| … |
… |
|
| 432 | 432 | |
| 433 | 433 | loader_read_child_output( |
| 434 | | child_ptr->project_name, |
| | 434 | child_ptr->vgraph_name, |
| 435 | 435 | child_ptr->app_name, |
| 436 | 436 | child_ptr->stderr, |
| … |
… |
|
| 453 | 453 | bool |
| 454 | 454 | loader_execute( |
| 455 | | const char * project_name, |
| | 455 | const char * vgraph_name, |
| 456 | 456 | const char * app_name, |
| 457 | 457 | const char * working_dir, |
| … |
… |
|
| 471 | 471 | } |
| 472 | 472 | |
| 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); |
| 477 | 477 | goto free_struct; |
| 478 | 478 | } |
| … |
… |
|
| 482 | 482 | { |
| 483 | 483 | log_error("strdup() failed to duplicate app name '%s'", app_name); |
| 484 | | goto free_project_name; |
| | 484 | goto free_vgraph_name; |
| 485 | 485 | } |
| 486 | 486 | |
| … |
… |
|
| 527 | 527 | if (pid == -1) |
| 528 | 528 | { |
| 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)); |
| 530 | 530 | list_del(&child_ptr->siblings); /* fork failed so it is not really a child process to watch for. */ |
| 531 | 531 | return false; |
| … |
… |
|
| 574 | 574 | } |
| 575 | 575 | |
| 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); |
| 577 | 577 | |
| 578 | 578 | *pid_ptr = child_ptr->pid = pid; |
| … |
… |
|
| 580 | 580 | return true; |
| 581 | 581 | |
| 582 | | free_project_name: |
| 583 | | free(child_ptr->project_name); |
| | 582 | free_vgraph_name: |
| | 583 | free(child_ptr->vgraph_name); |
| 584 | 584 | |
| 585 | 585 | free_struct: |