mirror of
git://git.gnupg.org/gnupg.git
synced 2025-03-28 22:49:59 +01:00
* gpgkeys_ldap.c (ldap2epochtime): We can always rely on timegm() being
available now, since it's a replacement function.
This commit is contained in:
parent
f8d4768309
commit
d8aa22f172
@ -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>
|
2004-05-20 David Shaw <dshaw@jabberwocky.com>
|
||||||
|
|
||||||
* gpgkeys_http.c: New program to do a simple HTTP file fetch using
|
* gpgkeys_http.c: New program to do a simple HTTP file fetch using
|
||||||
|
@ -53,12 +53,8 @@ static char *pgpkeystr="pgpKey";
|
|||||||
static FILE *input=NULL,*output=NULL,*console=NULL;
|
static FILE *input=NULL,*output=NULL,*console=NULL;
|
||||||
static LDAP *ldap=NULL;
|
static LDAP *ldap=NULL;
|
||||||
|
|
||||||
#if !HAVE_SETENV
|
#ifndef HAVE_TIMEGM
|
||||||
int setenv(const char *name, const char *value, int overwrite);
|
time_t timegm(struct tm *tm);
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !HAVE_UNSETENV
|
|
||||||
int unsetenv(const char *name);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct keylist
|
struct keylist
|
||||||
@ -185,24 +181,9 @@ ldap2epochtime(const char *timestr)
|
|||||||
pgptime.tm_isdst=-1;
|
pgptime.tm_isdst=-1;
|
||||||
pgptime.tm_mon--;
|
pgptime.tm_mon--;
|
||||||
|
|
||||||
/* mktime takes the timezone into account, and we can't have that.
|
/* mktime() takes the timezone into account, so we use timegm() */
|
||||||
I'd use timegm, but it's not portable. */
|
|
||||||
|
|
||||||
#ifdef HAVE_TIMEGM
|
|
||||||
answer=timegm(&pgptime);
|
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;
|
return answer;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user