summaryrefslogtreecommitdiffstats
path: root/source/utils/locktest.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/utils/locktest.c')
-rw-r--r--source/utils/locktest.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/source/utils/locktest.c b/source/utils/locktest.c
index f34e12885be..4697067e881 100644
--- a/source/utils/locktest.c
+++ b/source/utils/locktest.c
@@ -34,7 +34,7 @@ static BOOL use_oplocks;
#define FILENAME "\\locktest.dat"
#define LOCKRANGE 1000
-#define LOCKBASE 0
+#define LOCKBASE 0;
/*
#define LOCKBASE (0x40000000 - 50)
@@ -59,16 +59,14 @@ 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
+};
static struct record *recorded;
@@ -115,6 +113,7 @@ struct cli_state *connect_one(char *share)
char *server_n;
fstring server;
struct in_addr ip;
+ extern struct in_addr ipzero;
fstring myname;
static int count;
@@ -126,7 +125,7 @@ struct cli_state *connect_one(char *share)
server_n = server;
- zero_ip(&ip);
+ ip = ipzero;
slprintf(myname,sizeof(myname), "lock-%u-%u", getpid(), count++);
@@ -134,7 +133,7 @@ struct cli_state *connect_one(char *share)
make_nmb_name(&called , server, 0x20);
again:
- zero_ip(&ip);
+ ip = ipzero;
/* have to open a new connection */
if (!(c=cli_initialise(NULL)) || (cli_set_port(c, 139) == 0) ||
@@ -379,12 +378,9 @@ 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
- {
+ } else {
recorded[n].conn = random() % NCONNECTIONS;
recorded[n].f = random() % NFILES;
recorded[n].start = LOCKBASE + ((unsigned)random() % (LOCKRANGE-1));