* gpgkeys_ldap.c (ldap2epochtime): We can always rely on timegm() being

available now, since it's a replacement function.
This commit is contained in:
David Shaw 2004-05-21 15:46:53 +00:00
parent f8d4768309
commit d8aa22f172
2 changed files with 8 additions and 22 deletions

View File

@ -1,3 +1,8 @@
2004-05-21 David Shaw <dshaw@jabberwocky.com>
* gpgkeys_ldap.c (ldap2epochtime): We can always rely on timegm()
being available now, since it's a replacement function.
2004-05-20 David Shaw <dshaw@jabberwocky.com>
* gpgkeys_http.c: New program to do a simple HTTP file fetch using

View File

@ -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;
}