aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-11-14 15:33:58 -0500
committerNick Mathewson <nickm@torproject.org>2017-11-14 15:33:58 -0500
commitbf8a7201cea0dcd4da91cd67015bbdabc38c395a (patch)
tree96ee5094cc58e9e1282547920a41e2a062115063
parent702a13c9d34c413bef64aadef4853ea2acd9781f (diff)
downloadtor-bf8a7201cea0dcd4da91cd67015bbdabc38c395a.tar.gz
tor-bf8a7201cea0dcd4da91cd67015bbdabc38c395a.zip
Remove remove_file_if_very_old() -- nothing calls it.
-rw-r--r--src/or/config.c22
-rw-r--r--src/or/connection.h1
2 files changed, 0 insertions, 23 deletions
diff --git a/src/or/config.c b/src/or/config.c
index 23d67ca42f..b0a140d23b 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -7963,28 +7963,6 @@ write_to_data_subdir(const char* subdir, const char* fname,
return return_val;
}
-/** Given a file name check to see whether the file exists but has not been
- * modified for a very long time. If so, remove it. */
-void
-remove_file_if_very_old(const char *fname, time_t now)
-{
-#define VERY_OLD_FILE_AGE (28*24*60*60)
- struct stat st;
-
- log_debug(LD_FS, "stat()ing %s", fname);
- if (stat(sandbox_intern_string(fname), &st)==0 &&
- st.st_mtime < now-VERY_OLD_FILE_AGE) {
- char buf[ISO_TIME_LEN+1];
- format_local_iso_time(buf, st.st_mtime);
- log_notice(LD_GENERAL, "Obsolete file %s hasn't been modified since %s. "
- "Removing it.", fname, buf);
- if (unlink(fname) != 0) {
- log_warn(LD_FS, "Failed to unlink %s: %s",
- fname, strerror(errno));
- }
- }
-}
-
/** Return a smartlist of ports that must be forwarded by
* tor-fw-helper. The smartlist contains the ports in a string format
* that is understandable by tor-fw-helper. */
diff --git a/src/or/connection.h b/src/or/connection.h
index 450229ce8f..1d41a3c4f5 100644
--- a/src/or/connection.h
+++ b/src/or/connection.h
@@ -245,7 +245,6 @@ char *alloc_http_authenticator(const char *authenticator);
void assert_connection_ok(connection_t *conn, time_t now);
int connection_or_nonopen_was_started_here(or_connection_t *conn);
void connection_dump_buffer_mem_stats(int severity);
-void remove_file_if_very_old(const char *fname, time_t now);
void clock_skew_warning(const connection_t *conn, long apparent_skew,
int trusted, log_domain_mask_t domain,