aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--keyserver/ChangeLog5
-rw-r--r--keyserver/gpgkeys_ldap.c25
2 files changed, 8 insertions, 22 deletions
diff --git a/keyserver/ChangeLog b/keyserver/ChangeLog
index ff6a101a4..5ff4cc204 100644
--- a/keyserver/ChangeLog
+++ b/keyserver/ChangeLog
@@ -1,3 +1,8 @@
+2004-05-21 David Shaw <[email protected]>
+
+ * gpgkeys_ldap.c (ldap2epochtime): We can always rely on timegm()
+ being available now, since it's a replacement function.
+
2004-05-20 David Shaw <[email protected]>
* gpgkeys_http.c: New program to do a simple HTTP file fetch using
diff --git a/keyserver/gpgkeys_ldap.c b/keyserver/gpgkeys_ldap.c
index 42003b483..437699865 100644
--- a/keyserver/gpgkeys_ldap.c
+++ b/keyserver/gpgkeys_ldap.c
@@ -53,12 +53,8 @@ static char *pgpkeystr="pgpKey";
static FILE *input=NULL,*output=NULL,*console=NULL;
static LDAP *ldap=NULL;
-#if !HAVE_SETENV
-int setenv(const char *name, const char *value, int overwrite);
-#endif
-
-#if !HAVE_UNSETENV
-int unsetenv(const char *name);
+#ifndef HAVE_TIMEGM
+time_t timegm(struct tm *tm);
#endif
struct keylist
@@ -185,24 +181,9 @@ ldap2epochtime(const char *timestr)
pgptime.tm_isdst=-1;
pgptime.tm_mon--;
- /* mktime takes the timezone into account, and we can't have that.
- I'd use timegm, but it's not portable. */
+ /* mktime() takes the timezone into account, so we use timegm() */
-#ifdef HAVE_TIMEGM
answer=timegm(&pgptime);
-#else
- {
- char *zone=getenv("TZ");
- setenv("TZ","UTC",1);
- tzset();
- answer=mktime(&pgptime);
- if(zone)
- setenv("TZ",zone,1);
- else
- unsetenv("TZ");
- tzset();
- }
-#endif
return answer;
}