diff options
author | dkf <dkf@noemail.net> | 2005-08-09 13:31:27 (GMT) |
---|---|---|
committer | dkf <dkf@noemail.net> | 2005-08-09 13:31:27 (GMT) |
commit | bd552f0e1a76a9a6b32d11778e324b2a045052ab (patch) | |
tree | 623040ac11e2a471f429158e3d8328ba4a28602a /generic/tclClock.c | |
parent | 2735b0e221c6c19b9322c02dabd9dc7103930015 (diff) | |
download | tcl-bd552f0e1a76a9a6b32d11778e324b2a045052ab.zip tcl-bd552f0e1a76a9a6b32d11778e324b2a045052ab.tar.gz tcl-bd552f0e1a76a9a6b32d11778e324b2a045052ab.tar.bz2 |
Squelch a message about an unused variable.
FossilOrigin-Name: 5a1163b410fc8d6c833e0acea8ebf1ac26fc968c
Diffstat (limited to 'generic/tclClock.c')
-rw-r--r-- | generic/tclClock.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/generic/tclClock.c b/generic/tclClock.c index 9f3816b..47f1e74 100644 --- a/generic/tclClock.c +++ b/generic/tclClock.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclClock.c,v 1.38 2005/07/15 22:32:23 kennykb Exp $ + * RCS: @(#) $Id: tclClock.c,v 1.39 2005/08/09 13:31:27 dkf Exp $ */ #include "tclInt.h" @@ -207,10 +207,8 @@ TclClockLocaltimeObjCmd( ClientData clientData, static struct tm * ThreadSafeLocalTime(timePtr) - CONST time_t *timePtr; /* Pointer to the number of seconds - * since the local system's epoch - */ - + CONST time_t *timePtr; /* Pointer to the number of seconds since the + * local system's epoch */ { /* * Get a thread-local buffer to hold the returned time. @@ -218,20 +216,21 @@ ThreadSafeLocalTime(timePtr) struct tm *tmPtr = (struct tm *) Tcl_GetThreadData(&tmKey, (int) sizeof(struct tm)); - struct tm *sysTmPtr; #ifdef HAVE_LOCALTIME_R localtime_r(timePtr, tmPtr); #else + struct tm *sysTmPtr; + Tcl_MutexLock(&clockMutex); sysTmPtr = localtime(timePtr); - if ( sysTmPtr == NULL ) { - Tcl_MutexUnlock( &clockMutex ); + if (sysTmPtr == NULL) { + Tcl_MutexUnlock(&clockMutex); return NULL; } else { memcpy((VOID *) tmPtr, (VOID *) localtime(timePtr), sizeof(struct tm)); Tcl_MutexUnlock(&clockMutex); } -#endif +#endif return tmPtr; } |