summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2002-02-05 03:55:20 +0000
committerAndrew Tridgell <tridge@samba.org>2002-02-05 03:55:20 +0000
commit10ee1d22e606847d40fb013c694ed5733ef6b87b (patch)
treef02c76faf35013152d2549490feb359259b25db1 /source
parent2c67b266cc4848dff6066fcbc875ab5f91113179 (diff)
downloadsamba-10ee1d22e606847d40fb013c694ed5733ef6b87b.tar.gz
samba-10ee1d22e606847d40fb013c694ed5733ef6b87b.tar.xz
samba-10ee1d22e606847d40fb013c694ed5733ef6b87b.zip
- only show 1 cleanup msg per client
- show client count in progress
Diffstat (limited to 'source')
-rw-r--r--source/torture/nbio.c20
-rw-r--r--source/torture/torture.c4
2 files changed, 17 insertions, 7 deletions
diff --git a/source/torture/nbio.c b/source/torture/nbio.c
index 3262fdab6ae..7ce709dedda 100644
--- a/source/torture/nbio.c
+++ b/source/torture/nbio.c
@@ -39,6 +39,7 @@ static struct {
static struct {
double bytes_in, bytes_out;
int line;
+ int done;
} *children;
double nbio_total(void)
@@ -54,14 +55,15 @@ double nbio_total(void)
void nb_alarm(void)
{
int i;
- int lines=0;
+ int lines=0, num_clients=0;
if (nbio_id != -1) return;
for (i=0;i<nprocs;i++) {
lines += children[i].line;
+ if (!children[i].done) num_clients++;
}
- printf("%8d %.2f MB/sec\r", lines/nprocs, 1.0e-6 * nbio_total() / end_timer());
+ printf("%4d %8d %.2f MB/sec\r", num_clients, lines/nprocs, 1.0e-6 * nbio_total() / end_timer());
signal(SIGALRM, nb_alarm);
alarm(1);
@@ -107,6 +109,7 @@ void nb_setup(struct cli_state *cli)
signal(SIGSEGV, sigsegv);
c = cli;
start_timer();
+ children[nbio_id].done = 0;
}
@@ -262,7 +265,10 @@ static void delete_fn(file_info *finfo, const char *name, void *state)
n[strlen(n)-1] = 0;
asprintf(&s, "%s%s", n, finfo->name);
if (finfo->mode & aDIR) {
- nb_deltree(s);
+ char *s2;
+ asprintf(&s2, "%s\\*", s);
+ cli_list(c, s2, aDIR, delete_fn, NULL);
+ nb_rmdir(s);
} else {
total_deleted++;
nb_unlink(s);
@@ -277,10 +283,16 @@ void nb_deltree(char *dname)
asprintf(&mask, "%s\\*", dname);
total_deleted = 0;
-
cli_list(c, mask, aDIR, delete_fn, NULL);
free(mask);
cli_rmdir(c, dname);
if (total_deleted) printf("WARNING: Cleaned up %d files\n", total_deleted);
}
+
+
+void nb_cleanup(void)
+{
+ cli_rmdir(c, "clients");
+ children[nbio_id].done = 1;
+}
diff --git a/source/torture/torture.c b/source/torture/torture.c
index 7233e2799bd..fa8e43b705e 100644
--- a/source/torture/torture.c
+++ b/source/torture/torture.c
@@ -709,9 +709,7 @@ static BOOL run_netbench(int client)
}
fclose(f);
- slprintf(fname,sizeof(fname), "clients/client%d", client);
- rmdir(fname);
- rmdir("clients");
+ nb_cleanup();
if (!torture_close_connection(&cli)) {
correct = False;