| 429 | } |
| 430 | |
| 431 | static void copy_to_log(int fd) |
| 432 | { |
| 433 | struct strbuf line = STRBUF_INIT; |
| 434 | FILE *fp; |
| 435 | |
| 436 | fp = fdopen(fd, "r"); |
| 437 | if (!fp) { |
| 438 | logerror("fdopen of error channel failed"); |
| 439 | close(fd); |
| 440 | return; |
| 441 | } |
| 442 | |
| 443 | while (strbuf_getline_lf(&line, fp) != EOF) { |
| 444 | logerror("%s", line.buf); |
| 445 | strbuf_setlen(&line, 0); |
| 446 | } |
| 447 | |
| 448 | strbuf_release(&line); |
| 449 | fclose(fp); |
| 450 | } |
| 451 | |
| 452 | static int run_service_command(struct child_process *cld) |
| 453 | { |
no test coverage detected