rx: Fix AIX test_and_set_bit
authorSimon Wilkinson <sxw@your-file-system.com>
Sat, 2 Feb 2013 07:17:53 +0000 (07:17 +0000)
committerDerrick Brashear <shadow@your-file-system.com>
Sat, 2 Feb 2013 13:19:08 +0000 (05:19 -0800)
The AIX definition of rx_atomic_test_and_set_bit had its test the
wrong way round - so an already set bit would return false, and a clear
bit would return true. Fix this.

Change-Id: I7778c411016bca53b38257fca59ae0f7aaad64ae
Reviewed-on: http://gerrit.openafs.org/9021
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

src/rx/rx_atomic.h

index 83a52b4..5d3c7f5 100644 (file)
@@ -174,7 +174,7 @@ rx_atomic_clear_bit(rx_atomic_t *atomic, int bit) {
 
 static_inline int
 rx_atomic_test_and_set_bit(rx_atomic_t *atomic, int bit) {
-    return (fetch_and_or(&atomic->var, (1<<bit)) & 1<<bit) == 0;
+    return (fetch_and_or(&atomic->var, (1<<bit)) & 1<<bit) != 0;
 }
 
 static_inline int