See if we can stick to slightly valid C..
authorAndrew Bartlett <abartlet@samba.org>
Tue, 3 Jul 2001 04:29:50 +0000 (04:29 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 3 Jul 2001 04:29:50 +0000 (04:29 +0000)
(With thanks to tpot)

Andrew Bartlett
(This used to be commit e77cfe1379d92d2be4e2895454e14d11311a913d)

source3/torture/locktest.c

index cee18624a456f03b4cdb6e5bf59877e7f11657aa..ef6c9a978acf89cf198f46f8d3c64dc95dadccac 100644 (file)
@@ -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);