added -u hide_unlock_fails option
authorAndrew Tridgell <tridge@samba.org>
Wed, 24 May 2000 07:15:54 +0000 (07:15 +0000)
committerAndrew Tridgell <tridge@samba.org>
Wed, 24 May 2000 07:15:54 +0000 (07:15 +0000)
source/utils/locktest.c

index 9a02cf20ca9390d84b0a1882509bc78d49c2bbab..e2d05b7aa0fb57d737a03126a7dca7fff7a0151c 100644 (file)
@@ -29,6 +29,7 @@ static int got_pass;
 static int numops = 1000;
 static BOOL showall;
 static BOOL analyze;
+static BOOL hide_unlock_fails;
 
 #define FILENAME "\\locktest.dat"
 #define LOCKRANGE 100
@@ -264,14 +265,14 @@ static BOOL test_one(struct cli_state *cli[2][2],
                ret2 = cli_unlock(cli[1][conn], 
                                  fnum[1][conn][f],
                                  start, len);
-               if (showall || ret1 != ret2) {
+               if (showall || (!hide_unlock_fails && (ret1 != ret2))) {
                        printf("unlock conn=%u f=%u range=%u:%u(%u)       -> %u:%u\n",
                               conn, f, 
                               start, start+len-1, len,
                               ret1, ret2);
                }
                if (showall) brl_forall(print_brl);
-               if (ret1 != ret2) return False;
+               if (!hide_unlock_fails && ret1 != ret2) return False;
        } else {
                /* reopen the file */
                cli_close(cli[0][conn], fnum[0][conn][f]);
@@ -459,6 +460,7 @@ static void usage(void)
         -U user%%pass\n\
         -s seed\n\
         -o numops\n\
+        -u          hide unlock fails\n\
         -a          (show all ops)\n\
 ");
 }
@@ -524,6 +526,9 @@ static void usage(void)
                case 's':
                        seed = atoi(optarg);
                        break;
+               case 'u':
+                       hide_unlock_fails = True;
+                       break;
                case 'o':
                        numops = atoi(optarg);
                        break;