summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2001-07-03 04:29:50 +0000
committerAndrew Bartlett <abartlet@samba.org>2001-07-03 04:29:50 +0000
commit983d841e369eeecf0e2a501dfb9b97dfc367fb8d (patch)
treec26bfabc8f04a49d5eefa943adf0501fd4e21cbc
parent75e33b78036438b2a07eed3cc5a1e591103b7c9c (diff)
downloadsamba-983d841e369eeecf0e2a501dfb9b97dfc367fb8d.tar.gz
samba-983d841e369eeecf0e2a501dfb9b97dfc367fb8d.tar.bz2
samba-983d841e369eeecf0e2a501dfb9b97dfc367fb8d.zip
See if we can stick to slightly valid C..
(With thanks to tpot) Andrew Bartlett (This used to be commit e77cfe1379d92d2be4e2895454e14d11311a913d)
-rw-r--r--source3/torture/locktest.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source3/torture/locktest.c b/source3/torture/locktest.c
index cee18624a4..ef6c9a978a 100644
--- a/source3/torture/locktest.c
+++ b/source3/torture/locktest.c
@@ -59,14 +59,16 @@ struct record {
char needed;
};
+#define PRESETS 0
+
+#if PRESETS
static struct record preset[] = {
-#if 0
{36, 5, 0, 0, 0, 8, 1},
{ 2, 6, 0, 1, 0, 1, 1},
{53, 92, 0, 0, 0, 0, 1},
{99, 11, 0, 0, 7, 1, 1},
-#endif
};
+#endif
static struct record *recorded;
@@ -378,9 +380,11 @@ static void test_locks(char *share[NSERVERS])
recorded = (struct record *)malloc(sizeof(*recorded) * numops);
for (n=0; n<numops; n++) {
+#if PRESETS
if (n < sizeof(preset) / sizeof(preset[0])) {
recorded[n] = preset[n];
} else {
+#endif
recorded[n].conn = random() % NCONNECTIONS;
recorded[n].f = random() % NFILES;
recorded[n].start = LOCKBASE + ((unsigned)random() % (LOCKRANGE-1));
@@ -391,7 +395,9 @@ static void test_locks(char *share[NSERVERS])
recorded[n].r1 = random() % 100;
recorded[n].r2 = random() % 100;
recorded[n].needed = True;
+#if PRESETS
}
+#endif
}
reconnect(cli, fnum, share);