| 923 | static struct io_plan *setup_read(struct io_conn *conn, struct lightningd *ld); |
| 924 | |
| 925 | static struct io_plan *rotate_log(struct io_conn *conn, struct lightningd *ld) |
| 926 | { |
| 927 | log_info(ld->log, "Ending log due to SIGHUP"); |
| 928 | for (size_t i = 0; i < tal_count(ld->log->log_book->log_files); i++) { |
| 929 | if (streq(ld->logfiles[i], "-")) |
| 930 | continue; |
| 931 | fclose(ld->log->log_book->log_files[i]->f); |
| 932 | ld->log->log_book->log_files[i]->f = fopen(ld->logfiles[i], "a"); |
| 933 | if (!ld->log->log_book->log_files[i]->f) |
| 934 | err(1, "failed to reopen log file %s", ld->logfiles[i]); |
| 935 | } |
| 936 | |
| 937 | log_info(ld->log, "Started log due to SIGHUP"); |
| 938 | return setup_read(conn, ld); |
| 939 | } |
| 940 | |
| 941 | static struct io_plan *setup_read(struct io_conn *conn, struct lightningd *ld) |
| 942 | { |
nothing calls this directly
no test coverage detected