about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-03-16 10:16:43 +0000
committerUlrich Drepper <drepper@redhat.com>2003-03-16 10:16:43 +0000
commitb6e2f87a61dd5af7088aab32cd8377c55925354c (patch)
tree22709b176c3ea472461907452fd3033574ef74ef /sysdeps
parent51d0678c29b8e49e838c85d0ee7e98210a105695 (diff)
downloadglibc-b6e2f87a61dd5af7088aab32cd8377c55925354c.tar.gz
glibc-b6e2f87a61dd5af7088aab32cd8377c55925354c.tar.xz
glibc-b6e2f87a61dd5af7088aab32cd8377c55925354c.zip
Update.
2003-03-16  Ulrich Drepper  <drepper@redhat.com>

	* sysdeps/unix/clock_settime.c (HANDLE_REALTIME): Define tv here,
	not at function level.
	* sysdeps/unix/clock_gettime.c (HANDLE_REALTIME): Likewise.
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 4c26a370e6..b8b2b74e2f 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 0ef0bccc67..069336a69e 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);				      \