| 1065 | } |
| 1066 | |
| 1067 | static void log_dump_to_file(int fd, const struct log_book *log_book) |
| 1068 | { |
| 1069 | char buf[100]; |
| 1070 | int len; |
| 1071 | struct log_data data; |
| 1072 | time_t start; |
| 1073 | |
| 1074 | start = log_book->init_time.ts.tv_sec; |
| 1075 | len = snprintf(buf, sizeof(buf), "%zu bytes, %s", ringbuf_used(log_book), ctime(&start)); |
| 1076 | write_all(fd, buf, len); |
| 1077 | |
| 1078 | /* ctime includes \n... WTF? */ |
| 1079 | data.prefix = ""; |
| 1080 | data.fd = fd; |
| 1081 | log_each_line(log_book, log_one_line, &data); |
| 1082 | write_all(fd, "\n\n", strlen("\n\n")); |
| 1083 | } |
| 1084 | |
| 1085 | void log_backtrace_exit(void) |
| 1086 | { |
no test coverage detected