summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2005-08-09 13:31:27 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2005-08-09 13:31:27 (GMT)
commit5d99536c02360e7f2aa049ce61ed612895eacbdd (patch)
tree623040ac11e2a471f429158e3d8328ba4a28602a /generic
parente3a44d5bcdf9978525f969aa383aeede5ccbab34 (diff)
downloadtcl-5d99536c02360e7f2aa049ce61ed612895eacbdd.zip
tcl-5d99536c02360e7f2aa049ce61ed612895eacbdd.tar.gz
tcl-5d99536c02360e7f2aa049ce61ed612895eacbdd.tar.bz2
Squelch a message about an unused variable.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclClock.c17
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;
}