diff options
Diffstat (limited to 'source/utils/locktest.c')
-rw-r--r-- | source/utils/locktest.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/source/utils/locktest.c b/source/utils/locktest.c index 4697067e881..f34e12885be 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,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; @@ -113,7 +115,6 @@ 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; @@ -125,7 +126,7 @@ struct cli_state *connect_one(char *share) server_n = server; - ip = ipzero; + zero_ip(&ip); slprintf(myname,sizeof(myname), "lock-%u-%u", getpid(), count++); @@ -133,7 +134,7 @@ struct cli_state *connect_one(char *share) make_nmb_name(&called , server, 0x20); again: - ip = ipzero; + zero_ip(&ip); /* have to open a new connection */ if (!(c=cli_initialise(NULL)) || (cli_set_port(c, 139) == 0) || @@ -378,9 +379,12 @@ 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 { + } else +#endif + { recorded[n].conn = random() % NCONNECTIONS; recorded[n].f = random() % NFILES; recorded[n].start = LOCKBASE + ((unsigned)random() % (LOCKRANGE-1)); |