mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Add a tor_ftruncate to replace ftruncate.
(Windows doesn't have ftruncate, and some ftruncates do not move the file pointer to the start of the file.)
This commit is contained in:
+6
-2
@@ -1305,6 +1305,10 @@ switch_logs_debug(void)
|
||||
void
|
||||
truncate_logs(void)
|
||||
{
|
||||
for (logfile_t *lf = logfiles; lf; lf = lf->next)
|
||||
ftruncate(lf->fd, 0);
|
||||
for (logfile_t *lf = logfiles; lf; lf = lf->next) {
|
||||
if (lf->fd >= 0) {
|
||||
tor_ftruncate(lf->fd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user