Windows: Use roken gettimeofday implementation

Use the gettimeofday implementation from roken, rather than brewing
our own on Windows.

Change-Id: I02fc1a7f0f6aded2e16e2ed53e04054546fc0535
Reviewed-on: http://gerrit.openafs.org/4433
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
This commit is contained in:
Simon Wilkinson 2011-04-03 16:31:56 +01:00 committed by Jeffrey Altman
parent 21ed5186ae
commit f1e04bedb2
22 changed files with 37 additions and 41 deletions

View File

@ -110,7 +110,7 @@ pthread: hcrypto_headers
$(NTMAKE)
$(CD) ..\..\..
util: procmgmt_headers afsreg_headers lwp_headers rx_headers pthread
util: procmgmt_headers afsreg_headers lwp_headers rx_headers hcrypto
@echo ***** $@
$(DOCD) $(SRC)\$@
$(CD) $(SRC)\$@
@ -173,14 +173,14 @@ hcrypto: roken
$(NTMAKE)
$(CD) ..\..\..
roken: rxgen
roken: pthread
@echo ***** $@
$(DOCD) $(SRC)\roken
$(CD) $(SRC)\roken
$(NTMAKE)
$(CD) ..\..
rx: hcrypto
rx: rxgen
@echo ***** $@
$(DOCD) $(SRC)\$@
$(CD) $(SRC)\$@

View File

@ -1370,7 +1370,6 @@ AC_CHECK_FUNCS([ \
chown \
fchown \
gethostname \
gettimeofday \
lstat \
inet_aton \
inet_ntop \
@ -1407,6 +1406,7 @@ AC_REPLACE_FUNCS([ \
getdtablesize \
getopt \
getprogname \
gettimeofday \
localtime_r \
mkstemp \
strcasecmp \

View File

@ -23,7 +23,8 @@ EXELIBS =\
$(DESTDIR)\lib\afs\afseventlog.lib \
$(DESTDIR)\lib\afs\afsreg.lib \
$(DESTDIR)\lib\afs\afsprocmgmt.lib \
$(DESTDIR)\lib\afsicf.obj
$(DESTDIR)\lib\afsroken.lib \
$(DESTDIR)\lib\afsicf.obj
EXESDKLIBS=\
ole32.lib \

View File

@ -70,7 +70,8 @@ DLLLIBS =\
$(DESTDIR)\lib\libosi.lib \
$(DESTDIR)\lib\afs\afsreg.lib \
$(DESTDIR)\lib\afs\TaLocaleU.lib \
$(DESTDIR)\lib\afs\afsutil.lib
$(DESTDIR)\lib\afs\afsutil.lib \
$(DESTDIR)\lib\afsroken.lib
$(DLLFILE): $(DLLOBJS) $(DLLLIBS)
$(DLLCONLINK) /DEF:afs_shl_ext.def $(DLLSDKLIBS)

View File

@ -60,7 +60,8 @@ $(COMPILE_ET_EXEOBJS): $$(@B).c
$(C2OBJ) $**
COMPILE_ET_EXELIBS =\
$(DESTDIR)\lib\afs\afsutil.lib
$(DESTDIR)\lib\afs\afsutil.lib \
$(DESTDIR)\lib\afsroken.lib
$(COMPILE_ET_EXEFILE): $(COMPILE_ET_EXEOBJS) $(COMPILE_ET_EXERES) $(COMPILE_ET_EXELIBS)
$(EXECONLINK)

View File

@ -15,6 +15,7 @@
#include <afsconfig.h>
#include <afs/param.h>
#include <roken.h>
/*

View File

@ -70,8 +70,6 @@ AFSDEV_BUILDTYPE = NONE
!ENDIF
INCLUDE = $(AFSDEV_INCLUDE)
PATH = $(AFSDEV_BIN);$(PATH)
!IFNDEF AFSDEV_LIB
!ERROR Must define AFSDEV_LIB to be the default library directories.
!ENDIF
@ -192,6 +190,8 @@ OUT=$(OJT)\$(RELDIR)
APPVER=5.02
!ENDIF
PATH = $(AFSDEV_BIN);$(DESTDIR)\lib;$(PATH)
!INCLUDE <WIN32.MAK>
# Extend and/or supplement definitions in WIN32.MAK.

View File

@ -70,8 +70,6 @@ AFSDEV_BUILDTYPE = NONE
!ENDIF
INCLUDE = $(AFSDEV_INCLUDE)
PATH = $(AFSDEV_BIN);$(PATH)
!IFNDEF AFSDEV_LIB
!ERROR Must define AFSDEV_LIB to be the default library directories.
!ENDIF
@ -196,7 +194,7 @@ OUT=$(OJT)\$(RELDIR)
APPVER=5.0
!ENDIF
PATH = $(AFSDEV_BIN);$(DESTDIR)\lib;$(PATH)
!INCLUDE <WIN32.MAK>

View File

@ -74,8 +74,6 @@ AFSDEV_BUILDTYPE = NONE
!ENDIF
INCLUDE = $(AFSDEV_INCLUDE)
PATH = $(AFSDEV_BIN);$(PATH)
!IFNDEF AFSDEV_LIB
!ERROR Must define AFSDEV_LIB to be the default library directories.
!ENDIF
@ -200,7 +198,7 @@ OUT=$(OJT)\$(RELDIR)
APPVER=5.0
!ENDIF
PATH = $(AFSDEV_BIN);$(DESTDIR)\lib;$(PATH)
!INCLUDE <WIN32.MAK>

View File

@ -140,7 +140,8 @@ DLLLIBS =\
$(DESTDIR)\lib\afsrpc.lib \
$(DESTDIR)\lib\afs\afsutil.lib \
$(DESTDIR)\lib\afsauthent.lib \
$(DESTDIR)\lib\afs\afsreg.lib
$(DESTDIR)\lib\afs\afsreg.lib \
$(DESTDIR)\lib\afsroken.lib
!IF "$(CPU)" == "IA64" || "$(CPU)" == "AMD64" || "$(CPU)" == "ALPHA64"
KFWLIBS = \

View File

@ -39,7 +39,8 @@ DLLLIBS =\
$(DESTDIR)\lib\afs\afsvosadmin.lib \
$(DESTDIR)\lib\afsauthent.lib \
$(DESTDIR)\lib\afsrpc.lib \
$(DESTDIR)\lib\afspthread.lib
$(DESTDIR)\lib\afspthread.lib \
$(DESTDIR)\lib\afsroken.lib
$(DLLFILE): $(DLLOBJS) $(DLLLIBS)
$(DLLCONLINK) /DEF:bosadmin.def

View File

@ -56,7 +56,8 @@ DLLLIBS =\
$(DESTDIR)\lib\afsrpc.lib \
$(DESTDIR)\lib\afsauthent.lib \
$(DESTDIR)\lib\afs\afsreg.lib \
$(DESTDIR)\lib\libafsconf.lib
$(DESTDIR)\lib\libafsconf.lib \
$(DESTDIR)\lib\afsroken.lib
$(DLLFILE): $(DLLOBJS) $(DLLLIBS)
$(DLLCONLINK) /DEF:afscfgadmin.def shell32.lib

View File

@ -27,7 +27,8 @@ DLLLIBS =\
$(DESTDIR)\lib\afsauthent.lib \
$(DESTDIR)\lib\afsrpc.lib \
$(DESTDIR)\lib\afspthread.lib \
$(DESTDIR)\lib\afs\afsutil.lib
$(DESTDIR)\lib\afs\afsutil.lib \
$(DESTDIR)\lib\afsroken.lib
$(DLLFILE): $(DLLOBJS) $(DLLLIBS)
$(DLLCONLINK) /DEF:clientadmin.def

View File

@ -36,7 +36,8 @@ DLLLIBS =\
$(DESTDIR)\lib\afsauthent.lib \
$(DESTDIR)\lib\afsrpc.lib \
$(DESTDIR)\lib\afspthread.lib \
$(DESTDIR)\lib\afs\afsutil.lib
$(DESTDIR)\lib\afs\afsutil.lib \
$(DESTDIR)\lib\afsroken.lib
$(DLLFILE): $(DLLOBJS) $(DLLLIBS)
$(DLLCONLINK) /DEF:kasadmin.def

View File

@ -39,7 +39,8 @@ DLLLIBS =\
$(DESTDIR)\lib\afsauthent.lib \
$(DESTDIR)\lib\afsrpc.lib \
$(DESTDIR)\lib\afspthread.lib \
$(DESTDIR)\lib\afs\afsutil.lib
$(DESTDIR)\lib\afs\afsutil.lib \
$(DESTDIR)\lib\afsroken.lib
$(DLLFILE): $(DLLOBJS) $(DLLLIBS)
$(DLLCONLINK) /DEF:ptsadmin.def

View File

@ -23,7 +23,8 @@ AFSCP_EXELIBS =\
$(DESTDIR)\lib\afsauthent.lib \
$(DESTDIR)\lib\afsrpc.lib \
$(DESTDIR)\lib\afs\afsutil.lib \
$(DESTDIR)\lib\afs\afscmd.lib # static library
$(DESTDIR)\lib\afsroken.lib \
$(DESTDIR)\lib\afs\afscmd.lib # static library
AFSCP_EXEOBJS =\
$(OUT)\bos.obj \

View File

@ -60,7 +60,8 @@ DLLLIBS =\
$(DESTDIR)\lib\afs\afsadminutil.lib \
$(DESTDIR)\lib\afsauthent.lib \
$(DESTDIR)\lib\afsrpc.lib \
$(DESTDIR)\lib\afs\afsutil.lib
$(DESTDIR)\lib\afs\afsutil.lib \
$(DESTDIR)\lib\afsroken.lib
$(DLLFILE): $(DLLOBJS) $(DLLLIBS)
$(DLLCONLINK) /DEF:vosadmin.def

View File

@ -35,6 +35,7 @@ ROKEN_OBJS = \
$(OUT)\flock.obj \
$(OUT)\getopt.obj \
$(OUT)\getprogname.obj \
$(OUT)\gettimeofday.obj \
$(OUT)\hex.obj \
$(OUT)\issuid.obj \
$(OUT)\localtime_r.obj \

View File

@ -36,3 +36,4 @@ EXPORTS
rk_vsnprintf @40
rk_vasnprintf @41
rk_flock @42
rk_gettimeofday @43

View File

@ -19,6 +19,7 @@
rk_emalloc;
rk_erealloc;
rk_flock;
rk_gettimeofday;
rk_hex_encode;
rk_localtime_r;
rk_mkstemp;

View File

@ -72,13 +72,6 @@ extern void SetupLogSignals(void);
extern int afs_winsockInit(void);
extern void afs_winsockCleanup(void);
struct timezone {
int tz_minuteswest; /* of Greenwich */
int tz_dsttime; /* type of dst correction to apply */
};
#define gettimeofday afs_gettimeofday
int afs_gettimeofday(struct timeval *tv, struct timezone *tz);
/* Unbuffer output when Un*x would do line buffering. */
#define setlinebuf(S) setvbuf(S, NULL, _IONBF, 0)

View File

@ -12,6 +12,7 @@
#include <afsconfig.h>
#include <afs/param.h>
#include <roken.h>
#ifdef AFS_NT40_ENV
#include <winsock2.h>
@ -46,19 +47,10 @@ afs_winsockCleanup(void)
WSACleanup();
}
/* This function will begin to fail in the year 2038 */
/* exported from libafsauthent.dll */
int
afs_gettimeofday(struct timeval *tv, struct timezone *tz)
{
struct _timeb myTime;
_ftime(&myTime);
tv->tv_sec = myTime.time;
tv->tv_usec = myTime.millitm * 1000;
if (tz) {
tz->tz_minuteswest = myTime.timezone;
tz->tz_dsttime = myTime.dstflag;
}
return 0;
return rk_gettimeofday(tv, tz);
}
#endif