summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2015-08-08 00:45:26 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2015-08-08 00:45:26 +0200
commita225b2a5376bee47fbda86c8aaa74ca7cc8a388a (patch)
tree0d2d156d568bf099fb135f0d172d5436cf497d8e
parentc24278318f75ccd155b8575ad55f3135537088d8 (diff)
Revert "sfeed: set TZ=UTC at start, use mktime() not the deprecated timegm()."
Some libc implementations like musl provide a heavy optimized version of timeg() which mktime() cannot provide. We use -D_BSD_SOURCE anyway (also for strlcpy, strlcat), so just keep using this for now. This reverts commit f7c579c3b8e77215d60f1948367221b738823585.
-rw-r--r--sfeed.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/sfeed.c b/sfeed.c
index 045b1ad..b09d595 100644
--- a/sfeed.c
+++ b/sfeed.c
@@ -315,7 +315,7 @@ parsetime(const char *s, char *buf, size_t bufsiz, time_t *tp)
if (!(p = strptime(s, formats[i], &tm)))
continue;
tm.tm_isdst = -1; /* don't use DST */
- if ((t = mktime(&tm)) == -1) /* error */
+ if ((t = timegm(&tm)) == -1) /* error */
return -1;
if (gettimetz(p, tz, sizeof(tz), &tzoffset) == -1)
return -1;
@@ -719,11 +719,6 @@ main(int argc, char *argv[])
if (argc > 1)
baseurl = argv[1];
- /* set time to UTC+0 for manual time conversion */
- if (setenv("TZ", "UTC", 1) == -1)
- err(1, "setenv");
- tzset();
-
/* init strings and initial memory pool size */
string_buffer_init(&ctx.item.timestamp, 64);
string_buffer_init(&ctx.item.title, 256);