100 bytes is much too small for a buffer to hold an NFS filename.
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Tue, 19 Aug 2008 02:17:13 +0000 (12:17 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Tue, 19 Aug 2008 02:17:13 +0000 (12:17 +1000)
Make it default to 1024 bytes.

child.c
doc/dbench.1
doc/dbench.1.html

diff --git a/child.c b/child.c
index e4e626b99fa7cc47bdf3ad59a775ef06222af501..fbb2381f9c9d869b6a4420f38c38c4c3a87170b9 100644 (file)
--- a/child.c
+++ b/child.c
@@ -130,10 +130,11 @@ static void child_op(struct child_struct *child, const char *opname,
 
 
 /* run a test that simulates an approximate netbench client load */
+#define MAX_PARM_LEN 1024
 void child_run(struct child_struct *child0, const char *loadfile)
 {
        int i;
-       char line[1024], fname[1024], fname2[1024];
+       char line[MAX_PARM_LEN], fname[MAX_PARM_LEN], fname2[MAX_PARM_LEN];
        char **sparams, **params;
        char *p;
        const char *status;
@@ -149,7 +150,7 @@ void child_run(struct child_struct *child0, const char *loadfile)
 
        sparams = calloc(20, sizeof(char *));
        for (i=0;i<20;i++) {
-               sparams[i] = malloc(100);
+               sparams[i] = malloc(MAX_PARM_LEN);
        }
 
        f = fopen(loadfile, "r");
index c0fb0e2de759b6876b4748a9d9faec8967f07ac4..39e7b7a3d6492403d115c14b39d241a1bc9cbab7 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: dbench
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.71.0 <http://docbook.sf.net/>
-.\"      Date: 08/12/2008
+.\"      Date: 08/19/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "DBENCH" "1" "08/12/2008" "" ""
+.TH "DBENCH" "1" "08/19/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -113,6 +113,7 @@ This specifies whether "tcp" or "udp" is to be used. Default is "tcp".
 .RS 3n
 .nf
 Copyright (C) Andrew Tridgell 2008
+Copyright (C) Ronnie Sahlberg 2008
 
 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
index 3215513105c906527123d845e1d548906892d327..8a6c5b610023131610e1ab81ceede8d0edd0cfce 100644 (file)
       This specifies whether "tcp" or "udp" is to be used. Default is "tcp".
       </p></div></div><div class="refsect1" lang="en"><a name="id2528525"></a><h2>COPYRIGHT/LICENSE</h2><div class="literallayout"><p><br>
 Copyright (C) Andrew Tridgell 2008<br>
+Copyright (C) Ronnie Sahlberg 2008<br>
 <br>
 This program is free software; you can redistribute it and/or modify<br>
 it under the terms of the GNU General Public License as published by<br>