summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2022-03-29 19:10:44 (EDT)
committer P. J. McDermott <pj@pehjota.net>2022-03-29 19:13:23 (EDT)
commit84ced681a24c5ea7223f8f33554eb42266baab60 (patch)
tree639e90d10316fb4251d554fe3c5ed279b67aa233
parent5d52752e0cb715a1af4095c890dc623ce369f1ac (diff)
downloadatsign-84ced681a24c5ea7223f8f33554eb42266baab60.zip
atsign-84ced681a24c5ea7223f8f33554eb42266baab60.tar.gz
atsign-84ced681a24c5ea7223f8f33554eb42266baab60.tar.bz2
datetime: Drop newly unused use of timegm()
It's non-standard.
-rw-r--r--TODO1
-rw-r--r--configure.ac2
-rw-r--r--src/datetime.c22
-rw-r--r--src/datetime.h3
4 files changed, 1 insertions, 27 deletions
diff --git a/TODO b/TODO
index 0a038a3..2089ee9 100644
--- a/TODO
+++ b/TODO
@@ -1,4 +1,3 @@
-drop timegm()
try to fix dst bug
test with other libc's (newlib? musl? fbsd? obsd?)
`./@ 7:00 PM` doesn't work with musl strptime()
diff --git a/configure.ac b/configure.ac
index 133e8ee..40a3205 100644
--- a/configure.ac
+++ b/configure.ac
@@ -42,7 +42,7 @@ AC_CHECK_FUNCS(
[\
calloc difftime fprintf fputs free isspace localtime mktime \
printf realloc setvbuf sleep strerror strlen strftime strptime \
- time timegm
+ time
],
[],
[funcs_missing=true])
diff --git a/src/datetime.c b/src/datetime.c
index 2c971a4..0bba344 100644
--- a/src/datetime.c
+++ b/src/datetime.c
@@ -33,18 +33,6 @@
#include "datetime.h"
#include "formats.h"
-static struct tm DATETIME_EPOCH_ = {
- .tm_sec = 0,
- .tm_min = 0,
- .tm_hour = 0,
- .tm_mday = 1,
- .tm_mon = 0,
- .tm_year = 70,
- .tm_wday = 4,
- .tm_yday = 0,
- .tm_isdst = -1,
-};
-
static void
_datetime_buf_cpy_p(char *dst, const char *src)
{
@@ -403,13 +391,3 @@ datetime_strftime_misc(const struct tm *tm, char **out, size_t *buf_sz,
return _datetime_strftime(FORMATS_MISC, tm, out, buf_sz, buf, i);
}
-
-double
-datetime_diff_epoch(time_t t)
-{
- time_t epoch;
-
- epoch = timegm(&DATETIME_EPOCH_);
-
- return difftime(t, epoch);
-}
diff --git a/src/datetime.h b/src/datetime.h
index 9de8799..1094cf8 100644
--- a/src/datetime.h
+++ b/src/datetime.h
@@ -38,7 +38,4 @@ int
datetime_strftime_misc(const struct tm *tm, char **out, size_t *out_sz,
char **buf, size_t *i);
-double
-datetime_diff_epoch(time_t t);
-
#endif /* DATETIME_H_ */