Source-Changes-HG archive

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

[src/trunk]: src/external/bsd/bind/dist/lib/isc/noatomic/include/isc Fix retu...



details:   https://anonhg.NetBSD.org/src/rev/bd798899cd9c
branches:  trunk
changeset: 762416:bd798899cd9c
user:      ws <ws%NetBSD.org@localhost>
date:      Sun Feb 20 19:05:32 2011 +0000

description:
Fix return values.
OK christos.

diffstat:

 external/bsd/bind/dist/lib/isc/noatomic/include/isc/atomic.h |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (32 lines):

diff -r f1aed93c796f -r bd798899cd9c external/bsd/bind/dist/lib/isc/noatomic/include/isc/atomic.h
--- a/external/bsd/bind/dist/lib/isc/noatomic/include/isc/atomic.h      Sun Feb 20 17:32:02 2011 +0000
+++ b/external/bsd/bind/dist/lib/isc/noatomic/include/isc/atomic.h      Sun Feb 20 19:05:32 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: atomic.h,v 1.3 2011/02/16 03:47:13 christos Exp $      */
+/*     $NetBSD: atomic.h,v 1.4 2011/02/20 19:05:32 ws Exp $    */
 
 /*
  * Copyright (C) 2005, 2007  Internet Systems Consortium, Inc. ("ISC")
@@ -31,7 +31,7 @@
  */
 static __inline isc_int32_t
 isc_atomic_xadd(isc_int32_t *p, isc_int32_t val) {
-       isc_int32_t prev = val;
+       isc_int32_t prev = *p;
 
        *p += val;
 
@@ -53,11 +53,12 @@
  */
 static __inline isc_int32_t
 isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, isc_int32_t val) {
+       isc_int32_t prev = *p;
 
        if (*p == cmpval)
                *p = val;
 
-       return cmpval;
+       return prev;
 }
 
 #endif /* ISC_ATOMIC_H */



Home | Main Index | Thread Index | Old Index