1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-15 04:32:24 +00:00

Fix dtcm build on OpenBSD-current.

libcompat and header files will be gone in the upcoming 5.5 release, so we
cannot use the ftime(3) interface there.  Fall back to the SVR4 version of the
code, but use the tm_gmtoff field of struct tm to get the timezone.
Unfortunately, that is not portable (because I really really would like to
remove that old and crummy struct timeb from the public API).
This commit is contained in:
Pascal Stumpf 2014-02-21 18:02:36 +01:00 committed by Jon Trulson
parent 23e217b329
commit a4f9413950
3 changed files with 7 additions and 3 deletions

View file

@ -32,7 +32,7 @@ EXTRA_LIBRARIES = -lrpcsvc -lPW -ldiag
EXTRA_LIBRARIES = -lrpcsvc -lV3
#endif
#if defined(BSDArchitecture)
#if defined(BSDArchitecture) && !defined(OpenBSDArchitecture)
EXTRA_LIBRARIES = -lcompat
#endif

View file

@ -52,7 +52,7 @@
#ifndef _GETDATE_H
#define _GETDATE_H
#ifdef USG
#if defined(USG) || defined(__OpenBSD__)
struct timeb
{
time_t time;

View file

@ -528,11 +528,15 @@ time_t cm_getdate(char *p, struct timeb *now)
lptr = p;
if (now == ((struct timeb *) NULL)) {
now = &ftz;
#ifdef SVR4
#if defined(SVR4) || defined(__OpenBSD__)
tod = time(0);
lt = localtime(&tod);
now->time = lt->tm_sec;
#ifdef __OpenBSD__
now->timezone = lt->tm_gmtoff / 60;
#else
now->timezone = timezone/60;
#endif
#else
ftime(&ftz);
#endif /* SVR4 */