Fix dbench for client.txt
authorVolker Lendecke <vl@samba.org>
Sun, 7 Mar 2010 09:39:49 +0000 (10:39 +0100)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Mon, 8 Mar 2010 00:43:29 +0000 (11:43 +1100)
client.txt contains filenames with $, this conflicts with the RANDOMSTRING
feature

child.c

diff --git a/child.c b/child.c
index 982b78988d8d4f69f4dd28489fe498e687be5401..3b565dd2c093e2d7aac5f005f1c1707b7bb16235 100644 (file)
--- a/child.c
+++ b/child.c
@@ -320,6 +320,7 @@ void child_run(struct child_struct *child0, const char *loadfile)
        pid_t parent = getppid();
        double targett;
        struct child_struct *child;
+       int have_random = 0;
 
        gzf = gzopen(loadfile, "r");
        if (gzf == NULL) {
@@ -377,6 +378,7 @@ again:
 
                /* RANDOMSTRING */
                if (strncmp(line, "RANDOMSTRING", 12) == 0) {
+                       have_random = 1;
                        if (parse_randomstring(line) != 0) {
                                fprintf(stderr, "Incorrect RANDOMSTRING at line %d\n", child0->line);
                                goto done;
@@ -391,7 +393,7 @@ again:
                all_string_sub(line," /", " ");
 
                /* substitute all $<digit> stored strings */
-               while ((p = index(line, '$')) != NULL) {
+               while (have_random && (p = index(line, '$')) != NULL) {
                        char sstr[3], *nstr;
                        unsigned int idx;