diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-06-27 16:17:46 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-06-27 16:59:56 -0400 |
commit | 194a34cdc28c6b309dd9a32f5446409810b1d32b (patch) | |
tree | 6828a25a54dc81331bc1fead946a0c1ade2fede4 /src/common/compat.c | |
parent | 235ddb15a0f9fc322002ba39e8900634316dc333 (diff) | |
download | tor-194a34cdc28c6b309dd9a32f5446409810b1d32b.tar.gz tor-194a34cdc28c6b309dd9a32f5446409810b1d32b.zip |
Extract time encoding functions into lib/encoding
Diffstat (limited to 'src/common/compat.c')
-rw-r--r-- | src/common/compat.c | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/src/common/compat.c b/src/common/compat.c index cdc53175d0..48e706456e 100644 --- a/src/common/compat.c +++ b/src/common/compat.c @@ -965,40 +965,6 @@ compute_num_cpus(void) return num_cpus; } -/** As localtime_r, but defined for platforms that don't have it: - * - * Convert *<b>timep</b> to a struct tm in local time, and store the value in - * *<b>result</b>. Return the result on success, or NULL on failure. - */ -struct tm * -tor_localtime_r(const time_t *timep, struct tm *result) -{ - char *err = NULL; - struct tm *r = tor_localtime_r_msg(timep, result, &err); - if (err) { - log_warn(LD_BUG, "%s", err); - tor_free(err); - } - return r; -} - -/** As gmtime_r, but defined for platforms that don't have it: - * - * Convert *<b>timep</b> to a struct tm in UTC, and store the value in - * *<b>result</b>. Return the result on success, or NULL on failure. - */ -struct tm * -tor_gmtime_r(const time_t *timep, struct tm *result) -{ - char *err = NULL; - struct tm *r = tor_gmtime_r_msg(timep, result, &err); - if (err) { - log_warn(LD_BUG, "%s", err); - tor_free(err); - } - return r; -} - #if defined(HAVE_MLOCKALL) && HAVE_DECL_MLOCKALL && defined(RLIMIT_MEMLOCK) #define HAVE_UNIX_MLOCKALL #endif |