From b13ed6dec10637ec7fc499538e2c0270230f6abc Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Tue, 5 Feb 2008 17:11:45 +0000 Subject: [PATCH] DEVEL15-windows-down-time-20080205 LICENSE MIT use clock time instead of osi_Time() for server down time tracking for proper comparison with expiration times. (cherry picked from commit ac614c7609f61394da1ea425940a09bf98fbc0ea) --- src/WINNT/afsd/cm_aclent.c | 2 +- src/WINNT/afsd/cm_aclent.h | 2 +- src/WINNT/afsd/cm_callback.c | 4 ++-- src/WINNT/afsd/cm_conn.c | 2 +- src/WINNT/afsd/cm_server.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/WINNT/afsd/cm_aclent.c b/src/WINNT/afsd/cm_aclent.c index ad14a8abb0..2df8b40bb2 100644 --- a/src/WINNT/afsd/cm_aclent.c +++ b/src/WINNT/afsd/cm_aclent.c @@ -80,7 +80,7 @@ long cm_FindACLCache(cm_scache_t *scp, cm_user_t *userp, afs_uint32 *rightsp) for (aclp = scp->randomACLp; aclp; aclp = aclp->nextp) { if (aclp->userp == userp) { - if (aclp->tgtLifetime && aclp->tgtLifetime <= osi_Time()) { + if (aclp->tgtLifetime && aclp->tgtLifetime <= time(NULL)) { /* ticket expired */ osi_QRemoveHT((osi_queue_t **) &cm_data.aclLRUp, (osi_queue_t **) &cm_data.aclLRUEndp, &aclp->q); CleanupACLEnt(aclp); diff --git a/src/WINNT/afsd/cm_aclent.h b/src/WINNT/afsd/cm_aclent.h index 61eaa6b902..1116930494 100644 --- a/src/WINNT/afsd/cm_aclent.h +++ b/src/WINNT/afsd/cm_aclent.h @@ -26,7 +26,7 @@ typedef struct cm_aclent { struct cm_scache *backp; /* back ptr to vnode */ struct cm_user *userp; /* user whose access is cached */ afs_uint32 randomAccess; /* watch for more rights in acl.h */ - unsigned long tgtLifetime; /* time this expires */ + afs_uint32 tgtLifetime; /* time this expires */ } cm_aclent_t; extern osi_rwlock_t cm_aclLock; diff --git a/src/WINNT/afsd/cm_callback.c b/src/WINNT/afsd/cm_callback.c index 629f3a88f7..96f6c36e1d 100644 --- a/src/WINNT/afsd/cm_callback.c +++ b/src/WINNT/afsd/cm_callback.c @@ -1062,7 +1062,7 @@ SRXAFSCB_InitCallBackState3(struct rx_call *callp, afsUUID* serverUuid) char *p = NULL; if (UuidToString((UUID *)serverUuid, &p) == RPC_S_OK) { - osi_Log1(afsd_logp, "SRXAFSCB_InitCallBackState3 %s ->",p); + osi_Log1(afsd_logp, "SRXAFSCB_InitCallBackState3 %s ->",osi_LogSaveString(afsd_logp,p)); RpcStringFree(&p); } else osi_Log0(afsd_logp, "SRXAFSCB_InitCallBackState3 - no server Uuid ->"); @@ -1969,7 +1969,7 @@ cm_GiveUpAllCallbacks(cm_server_t *tsp, afs_int32 markDown) lock_ObtainMutex(&tsp->mx); if (!(tsp->flags & CM_SERVERFLAG_DOWN)) { tsp->flags |= CM_SERVERFLAG_DOWN; - tsp->downTime = osi_Time(); + tsp->downTime = time(NULL); } cm_ForceNewConnections(tsp); diff --git a/src/WINNT/afsd/cm_conn.c b/src/WINNT/afsd/cm_conn.c index 7233df63fc..52b8323ad7 100644 --- a/src/WINNT/afsd/cm_conn.c +++ b/src/WINNT/afsd/cm_conn.c @@ -563,7 +563,7 @@ cm_Analyze(cm_conn_t *connp, cm_user_t *userp, cm_req_t *reqp, if (reqp->flags & CM_REQ_NEW_CONN_FORCED) { if (!(serverp->flags & CM_SERVERFLAG_DOWN)) { serverp->flags |= CM_SERVERFLAG_DOWN; - serverp->downTime = osi_Time(); + serverp->downTime = time(NULL); } } else { reqp->flags |= CM_REQ_NEW_CONN_FORCED; diff --git a/src/WINNT/afsd/cm_server.c b/src/WINNT/afsd/cm_server.c index a476740706..436d917193 100644 --- a/src/WINNT/afsd/cm_server.c +++ b/src/WINNT/afsd/cm_server.c @@ -154,7 +154,7 @@ cm_PingServer(cm_server_t *tsp) /* mark server as down */ if (!(tsp->flags & CM_SERVERFLAG_DOWN)) { tsp->flags |= CM_SERVERFLAG_DOWN; - tsp->downTime = osi_Time(); + tsp->downTime = time(NULL); } if (code != VRESTARTING) cm_ForceNewConnections(tsp);