trying to get HEAD building again. If you want the code
[gd/samba-autobuild/.git] / source3 / torture / torture.c
index 840b6ad2947a26e77da71cd3a48829e57d638888..f26ebb49b30e4290690646883063b2b2ab9d48b3 100644 (file)
@@ -866,7 +866,7 @@ static BOOL run_locktest1(int dummy)
        lock_timeout = (1 + (random() % 20));
        printf("Testing lock timeout with timeout=%u\n", lock_timeout);
        t1 = time(NULL);
-       if (cli_lock(cli2, fnum3, 0, 4, lock_timeout * 1000, WRITE_LOCK)) {
+       if (cli_lock(cli2, fnum3, 0, 4, lock_timeout * 500, WRITE_LOCK)) {
                printf("lock3 succeeded! This is a locking bug\n");
                return False;
        } else {
@@ -875,9 +875,10 @@ static BOOL run_locktest1(int dummy)
        }
        t2 = time(NULL);
 
-       if (t2 - t1 < 5) {
+       if (ABS(t2 - t1) < lock_timeout-1) {
                printf("error: This server appears not to support timed lock requests\n");
        }
+
        printf("server slept for %u seconds for a %u second timeout\n",
               (unsigned int)(t2-t1), lock_timeout);
 
@@ -1121,7 +1122,7 @@ static BOOL run_tcon_devtype_test(int dummy)
        BOOL retry;
        int flags = 0;
        NTSTATUS status;
-       BOOL ret;
+       BOOL ret = True;
 
        status = cli_full_connection(&cli1, myname,
                                     host, NULL, port_to_use,