aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/unix/clock_gettime.c2
-rw-r--r--sysdeps/unix/clock_settime.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/sysdeps/unix/clock_gettime.c b/sysdeps/unix/clock_gettime.c
index 4c26a37..b8b2b74 100644
--- a/sysdeps/unix/clock_gettime.c
+++ b/sysdeps/unix/clock_gettime.c
@@ -41,13 +41,13 @@ extern int __pthread_clock_gettime (hp_timing_t freq, struct timespec *tp)
int
clock_gettime (clockid_t clock_id, struct timespec *tp)
{
- struct timeval tv;
int retval = -1;
switch (clock_id)
{
#define HANDLE_REALTIME \
do { \
+ struct timeval tv; \
retval = gettimeofday (&tv, NULL); \
if (retval == 0) \
/* Convert into `timespec'. */ \
diff --git a/sysdeps/unix/clock_settime.c b/sysdeps/unix/clock_settime.c
index 0ef0bcc..069336a 100644
--- a/sysdeps/unix/clock_settime.c
+++ b/sysdeps/unix/clock_settime.c
@@ -40,7 +40,6 @@ extern void __pthread_clock_settime (hp_timing_t offset)
int
clock_settime (clockid_t clock_id, const struct timespec *tp)
{
- struct timeval tv;
int retval;
/* Make sure the time cvalue is OK. */
@@ -54,6 +53,7 @@ clock_settime (clockid_t clock_id, const struct timespec *tp)
{
#define HANDLE_REALTIME \
do { \
+ struct timeval tv; \
TIMESPEC_TO_TIMEVAL (&tv, tp); \
\
retval = settimeofday (&tv, NULL); \