Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libpthread for safety, declare mono on the outermost blo...



details:   https://anonhg.NetBSD.org/src/rev/0045ad4a78eb
branches:  trunk
changeset: 785832:0045ad4a78eb
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Apr 01 13:28:21 2013 +0000

description:
for safety, declare mono on the outermost block it is used.

diffstat:

 lib/libpthread/pthread_cond.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (35 lines):

diff -r 60bf6ecb58dc -r 0045ad4a78eb lib/libpthread/pthread_cond.c
--- a/lib/libpthread/pthread_cond.c     Mon Apr 01 12:31:34 2013 +0000
+++ b/lib/libpthread/pthread_cond.c     Mon Apr 01 13:28:21 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pthread_cond.c,v 1.60 2013/03/28 18:07:12 christos Exp $       */
+/*     $NetBSD: pthread_cond.c,v 1.61 2013/04/01 13:28:21 christos Exp $       */
 
 /*-
  * Copyright (c) 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -46,7 +46,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: pthread_cond.c,v 1.60 2013/03/28 18:07:12 christos Exp $");
+__RCSID("$NetBSD: pthread_cond.c,v 1.61 2013/04/01 13:28:21 christos Exp $");
 
 #include <stdlib.h>
 #include <errno.h>
@@ -131,6 +131,7 @@
 {
        pthread_t self;
        int retval;
+       struct timespec mono;
 
        if (__predict_false(__uselibcstub))
                return __libc_cond_timedwait_stub(cond, mutex, abstime);
@@ -147,7 +148,7 @@
                 * extra system calls! 
                 */
                if (pthread_cond_getclock(cond) == CLOCK_MONOTONIC) {
-                       struct timespec mono, real;
+                       struct timespec real;
                        if (clock_gettime(CLOCK_REALTIME, &real) == -1 ||
                            clock_gettime(CLOCK_MONOTONIC, &mono) == -1)
                                return errno;



Home | Main Index | Thread Index | Old Index