summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <jaxboe@fusionio.com>2011-01-13 18:57:54 +0100
committerJens Axboe <jaxboe@fusionio.com>2011-01-13 18:57:54 +0100
commit6f260b317f4cec3027f79b8b329dd3f98c3906ac (patch)
tree979339c1cd9ea7843e3d22199ce7e24af175b7b6
parent2f2e98e639986bdc7aa422d73cc523cb32b725c6 (diff)
downloadfio-6f260b317f4cec3027f79b8b329dd3f98c3906ac.tar.gz
fio-6f260b317f4cec3027f79b8b329dd3f98c3906ac.tar.bz2
Correct basename usage for verify dump
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
-rw-r--r--verify.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/verify.c b/verify.c
index b0599942..14d32134 100644
--- a/verify.c
+++ b/verify.c
@@ -198,11 +198,11 @@ struct vcont {
static void dump_buf(char *buf, unsigned int len, unsigned long long offset,
const char *type, struct fio_file *f)
{
- char fname[256];
+ char *ptr, fname[256];
int ret, fd;
- strcpy(fname, f->file_name);
- basename(fname);
+ ptr = strdup(f->file_name);
+ strcpy(fname, basename(ptr));
sprintf(fname + strlen(fname), ".%llu.%s", offset, type);
@@ -226,6 +226,7 @@ static void dump_buf(char *buf, unsigned int len, unsigned long long offset,
close(fd);
log_err(" %s data dumped as %s\n", type, fname);
+ free(ptr);
}
/*