| 159 | } |
| 160 | |
| 161 | static apr_status_t file_cache_el_final(disk_cache_conf *conf, disk_cache_file_t *file, |
| 162 | request_rec *r) |
| 163 | { |
| 164 | apr_status_t rv = APR_SUCCESS; |
| 165 | |
| 166 | /* This assumes that the tempfiles are on the same file system |
| 167 | * as the cache_root. If not, then we need a file copy/move |
| 168 | * rather than a rename. |
| 169 | */ |
| 170 | |
| 171 | /* move the file over */ |
| 172 | if (file->tempfd) { |
| 173 | |
| 174 | rv = safe_file_rename(conf, file->tempfile, file->file, file->pool); |
| 175 | if (rv != APR_SUCCESS) { |
| 176 | ap_log_rerror(APLOG_MARK, APLOG_WARNING, rv, r, APLOGNO(00699) |
| 177 | "rename tempfile to file failed:" |
| 178 | " %s -> %s", file->tempfile, file->file); |
| 179 | apr_file_remove(file->tempfile, file->pool); |
| 180 | } |
| 181 | |
| 182 | file->tempfd = NULL; |
| 183 | } |
| 184 | |
| 185 | return rv; |
| 186 | } |
| 187 | |
| 188 | static apr_status_t file_cache_temp_cleanup(void *dummy) |
| 189 | { |
no test coverage detected