r23779: Change from v2 or later to v3 or later.
[amitay/samba.git] / source3 / torture / nbio.c
index 6c51db3cf3020f93104d836a0f6a74d501338d5a..3a9c69b1e48b3c7dff0c92614c790b942dc7a8e5 100644 (file)
@@ -7,7 +7,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,
@@ -20,8 +20,6 @@
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-#define NO_SYSLOG
-
 #include "includes.h"
 
 #define MAX_FILES 1000
@@ -36,7 +34,7 @@ static struct {
        int handle;
 } ftable[MAX_FILES];
 
-static struct {
+static struct children {
        double bytes_in, bytes_out;
        int line;
        int done;
@@ -52,7 +50,7 @@ double nbio_total(void)
        return total;
 }
 
-void nb_alarm(void)
+void nb_alarm(int ignore)
 {
        int i;
        int lines=0, num_clients=0;
@@ -72,13 +70,14 @@ void nb_alarm(void)
 void nbio_shmem(int n)
 {
        nprocs = n;
-       children = shm_setup(sizeof(*children) * nprocs);
+       children = (struct children *)shm_setup(sizeof(*children) * nprocs);
        if (!children) {
                printf("Failed to setup shared memory!\n");
                exit(1);
        }
 }
 
+#if 0
 static int ne_find_handle(int handle)
 {
        int i;
@@ -88,6 +87,7 @@ static int ne_find_handle(int handle)
        }
        return -1;
 }
+#endif
 
 static int find_handle(int handle)
 {
@@ -226,11 +226,11 @@ void nb_rmdir(const char *fname)
        }
 }
 
-void nb_rename(const char *old, const char *new)
+void nb_rename(const char *oldname, const char *newname)
 {
-       if (!cli_rename(c, old, new)) {
+       if (!cli_rename(c, oldname, newname)) {
                printf("ERROR: rename %s %s failed (%s)\n", 
-                      old, new, cli_errstr(c));
+                      oldname, newname, cli_errstr(c));
                exit(1);
        }
 }
@@ -255,7 +255,7 @@ void nb_qfsinfo(int level)
        cli_dskattr(c, &bsize, &total, &avail);
 }
 
-static void find_fn(file_info *finfo, const char *name, void *state)
+static void find_fn(const char *mnt, file_info *finfo, const char *name, void *state)
 {
        /* noop */
 }
@@ -274,12 +274,12 @@ void nb_flush(int fnum)
 
 static int total_deleted;
 
-static void delete_fn(file_info *finfo, const char *name, void *state)
+static void delete_fn(const char *mnt, file_info *finfo, const char *name, void *state)
 {
        char *s, *n;
        if (finfo->name[0] == '.') return;
 
-       n = strdup(name);
+       n = SMB_STRDUP(name);
        n[strlen(n)-1] = 0;
        asprintf(&s, "%s%s", n, finfo->name);
        if (finfo->mode & aDIR) {