summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBjörn Jacke <bj@sernet.de>2012-08-10 21:50:22 +0200
committerBjoern Jacke <bj@sernet.de>2012-08-10 23:33:20 +0200
commit1f50b6c3aefe9a7ac64641b1e9c23e014459647f (patch)
tree86af99fa3a1b4b30da108a7c46a7ec568a39141a /lib
parent8defcb8bd1292376c2c00f1d432fe751c207f872 (diff)
downloadsamba-1f50b6c3aefe9a7ac64641b1e9c23e014459647f.tar.gz
samba-1f50b6c3aefe9a7ac64641b1e9c23e014459647f.tar.bz2
samba-1f50b6c3aefe9a7ac64641b1e9c23e014459647f.zip
tdb/test: fix build on OSF/1
Autobuild-User(master): Björn Jacke <bj@sernet.de> Autobuild-Date(master): Fri Aug 10 23:33:20 CEST 2012 on sn-devel-104
Diffstat (limited to 'lib')
-rw-r--r--lib/tdb/test/lock-tracking.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/lib/tdb/test/lock-tracking.c b/lib/tdb/test/lock-tracking.c
index b6f1cc27d0..90a07f8ef1 100644
--- a/lib/tdb/test/lock-tracking.c
+++ b/lib/tdb/test/lock-tracking.c
@@ -7,13 +7,13 @@
#include "tap-interface.h"
#include "lock-tracking.h"
-struct lock {
- struct lock *next;
+struct testlock {
+ struct testlock *next;
unsigned int off;
unsigned int len;
int type;
};
-static struct lock *locks;
+static struct testlock *testlocks;
int locking_errors = 0;
bool suppress_lockcheck = false;
bool nonblocking_locks;
@@ -52,10 +52,10 @@ int fcntl_with_lockcheck(int fd, int cmd, ... /* arg */ )
}
if (fl->l_type == F_UNLCK) {
- struct lock **l;
- struct lock *old = NULL;
+ struct testlock **l;
+ struct testlock *old = NULL;
- for (l = &locks; *l; l = &(*l)->next) {
+ for (l = &testlocks; *l; l = &(*l)->next) {
if ((*l)->off == fl->l_start
&& (*l)->len == fl->l_len) {
if (ret == 0) {
@@ -72,13 +72,13 @@ int fcntl_with_lockcheck(int fd, int cmd, ... /* arg */ )
locking_errors++;
}
} else {
- struct lock *new, *i;
+ struct testlock *new, *i;
unsigned int fl_end = fl->l_start + fl->l_len;
if (fl->l_len == 0)
fl_end = (unsigned int)-1;
/* Check for overlaps: we shouldn't do this. */
- for (i = locks; i; i = i->next) {
+ for (i = testlocks; i; i = i->next) {
unsigned int i_end = i->off + i->len;
if (i->len == 0)
i_end = (unsigned int)-1;
@@ -110,7 +110,7 @@ int fcntl_with_lockcheck(int fd, int cmd, ... /* arg */ )
goto done;
}
if (!suppress_lockcheck) {
- diag("%s lock %u@%u overlaps %u@%u",
+ diag("%s testlock %u@%u overlaps %u@%u",
fl->l_type == F_WRLCK ? "write" : "read",
(int)fl->l_len, (int)fl->l_start,
i->len, (int)i->off);
@@ -123,8 +123,8 @@ int fcntl_with_lockcheck(int fd, int cmd, ... /* arg */ )
new->off = fl->l_start;
new->len = fl->l_len;
new->type = fl->l_type;
- new->next = locks;
- locks = new;
+ new->next = testlocks;
+ testlocks = new;
}
}
done:
@@ -136,10 +136,10 @@ done:
unsigned int forget_locking(void)
{
unsigned int num = 0;
- while (locks) {
- struct lock *next = locks->next;
- free(locks);
- locks = next;
+ while (testlocks) {
+ struct testlock *next = testlocks->next;
+ free(testlocks);
+ testlocks = next;
num++;
}
return num;