init storage with TZ

This commit is contained in:
Jan-Piet Mens
2015-09-01 14:02:32 +02:00
parent 1b0448d863
commit 550fd4fc59
2 changed files with 5 additions and 1 deletions
+3
View File
@@ -128,6 +128,7 @@ int ev_handler(struct mg_connection *conn, enum mg_event ev)
return MG_TRUE;
case MG_REQUEST:
ctype = mg_get_header(conn, "accept");
if (ctype != NULL)
fprintf(stderr, "ACCEPT: %s\n", ctype);
@@ -180,6 +181,8 @@ int ev_handler(struct mg_connection *conn, enum mg_event ev)
return (MG_FALSE); /* Fail it */
}
storage_init();
/* GET */
if (!strcmp(conn->uri, "/api/me")) {
push_geojson(conn);
+2 -1
View File
@@ -26,6 +26,8 @@ void storage_init()
{
char path[BUFSIZ];
setenv("TZ", "UTC", 1);
snprintf(path, BUFSIZ, "%s/ghash", STORAGEDIR);
gc = gcache_open(path, TRUE);
}
@@ -223,7 +225,6 @@ int make_times(char *time_from, time_t *s_lo, char *time_to, time_t *s_hi)
{
time_t now;
setenv("TZ", "UTC", 1); // FIXME: really?
time(&now);
if (!time_from || !*time_from) {