| 1078 | } |
| 1079 | |
| 1080 | static void log_dump_to_file(int fd, const struct log_book *log_book) |
| 1081 | { |
| 1082 | char buf[100]; |
| 1083 | int len; |
| 1084 | struct log_data data; |
| 1085 | time_t start; |
| 1086 | |
| 1087 | start = log_book->init_time.ts.tv_sec; |
| 1088 | len = snprintf(buf, sizeof(buf), "%zu bytes, %s", ringbuf_used(log_book), ctime(&start)); |
| 1089 | write_all(fd, buf, len); |
| 1090 | |
| 1091 | /* ctime includes \n... WTF? */ |
| 1092 | data.prefix = ""; |
| 1093 | data.fd = fd; |
| 1094 | log_each_line(log_book, log_one_line, &data); |
| 1095 | write_all(fd, "\n\n", strlen("\n\n")); |
| 1096 | } |
| 1097 | |
| 1098 | void log_backtrace_exit(void) |
| 1099 | { |
no test coverage detected