[PATCH] fio: use temporary storage before calling dirname()
authorJens Axboe <axboe@suse.de>
Mon, 28 Nov 2005 15:09:02 +0000 (16:09 +0100)
committerJens Axboe <axboe@suse.de>
Mon, 28 Nov 2005 15:09:02 +0000 (16:09 +0100)
fio.c

diff --git a/fio.c b/fio.c
index 9a87f60eb006517d490dd5c1f4a989f1c5120262..5d56f527c3204cabe20fc9a19d0aae8154dcf515 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -1662,7 +1662,8 @@ static void init_disk_util(struct thread_data *td)
                /*
                 * must be a file, open "." in that path
                 */
-               p = dirname(td->file_name);
+               strcpy(foo, td->file_name);
+               p = dirname(foo);
                if (stat(p, &st)) {
                        perror("disk util stat");
                        return;