r23779: Change from v2 or later to v3 or later.
[amitay/samba.git] / source3 / torture / locktest.c
index 92838f0ff20de8130d15fe7ea5cae5500887770c..97242541d48a628edab02643bb45460727febc7e 100644 (file)
@@ -5,7 +5,7 @@
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
    
    This program is distributed in the hope that it will be useful,
@@ -121,7 +121,8 @@ static void print_brl(struct file_id id,
                        enum brl_type lock_type,
                        enum brl_flavour lock_flav,
                        br_off start,
-                       br_off size)
+                       br_off size,
+                       void *private_data)
 {
 #if NASTY_POSIX_LOCK_HACK
        {
@@ -147,7 +148,7 @@ static void print_brl(struct file_id id,
 
 static void show_locks(void)
 {
-       brl_forall(print_brl);
+       brl_forall(print_brl, NULL);
        /* system("cat /proc/locks"); */
 }
 
@@ -164,6 +165,7 @@ static struct cli_state *connect_one(char *share, int snum)
        struct in_addr ip;
        fstring myname;
        static int count;
+       NTSTATUS status;
 
        fstrcpy(server,share+2);
        share = strchr_m(server,'\\');
@@ -184,11 +186,17 @@ static struct cli_state *connect_one(char *share, int snum)
         zero_ip(&ip);
 
        /* have to open a new connection */
-       if (!(c=cli_initialise()) || !cli_connect(c, server_n, &ip)) {
+       if (!(c=cli_initialise())) {
                DEBUG(0,("Connection to %s failed\n", server_n));
                return NULL;
        }
 
+       status = cli_connect(c, server_n, &ip);
+       if (!NT_STATUS_IS_OK(status)) {
+               DEBUG(0,("Connection to %s failed. Error %s\n", server_n, nt_errstr(status) ));
+               return NULL;
+       }
+
        c->use_kerberos = use_kerberos;
 
        if (!cli_session_request(c, &calling, &called)) {