| 1020 | } |
| 1021 | |
| 1022 | static void event_flatstore_timer(unsigned int ticks, void *param) |
| 1023 | { |
| 1024 | struct flat_file* file; |
| 1025 | |
| 1026 | /* we only run when ticks is multiple of file_rotate_period */ |
| 1027 | if (time(NULL) % file_rotate_period != 0) |
| 1028 | return; |
| 1029 | |
| 1030 | lock_get(global_lock); |
| 1031 | for (file = *list_files; file; file = file->next) { |
| 1032 | file->rotate_version++; |
| 1033 | file->record_count = 0; |
| 1034 | file->bytes_written = 0; |
| 1035 | ensure_file_path(file, 1); |
| 1036 | raise_rotation_event(file, ROTATE_REASON_PERIOD); |
| 1037 | LM_DBG("File %s is being rotated at %u - new file is %s\n", |
| 1038 | file->path.s, ticks, file->pathname); |
| 1039 | } |
| 1040 | /* inform everyone they need to rotate */ |
| 1041 | lock_release(global_lock); |
| 1042 | ipc_send_rpc_all(event_flatstore_rotate, 0); |
| 1043 | } |
| 1044 | |
| 1045 | static void verify_delete(void) { |
| 1046 | struct flat_delete *del_it, *del_prev, *del_tmp; |
nothing calls this directly
no test coverage detected