summaryrefslogtreecommitdiff
path: root/btt/seek.c
diff options
context:
space:
mode:
authorAlan D. Brunelle <alan.brunelle@hp.com>2009-10-08 08:39:02 -0400
committerAlan D. Brunelle <alan.brunelle@hp.com>2009-10-08 08:39:02 -0400
commita155ab989ffc8b9cf95a631309e9a825d04bcc68 (patch)
tree2fcf17c8a1e3a9c2f2e128dec4e7d14a8e118dca /btt/seek.c
parent677ef89ccb24fb3e38b13b02b9394318afb78f30 (diff)
downloadblktrace-a155ab989ffc8b9cf95a631309e9a825d04bcc68.tar.gz
blktrace-a155ab989ffc8b9cf95a631309e9a825d04bcc68.tar.bz2
btt: better data file naming
More logical naming for .dat files created. Signed-off-by: Alan D. Brunelle <alan.brunelle@hp.com>
Diffstat (limited to 'btt/seek.c')
-rw-r--r--btt/seek.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/btt/seek.c b/btt/seek.c
index 4a03fbe..abdb0ee 100644
--- a/btt/seek.c
+++ b/btt/seek.c
@@ -205,10 +205,12 @@ long long seek_dist(struct seeki *sip, struct io *iop)
return dist;
}
-void *seeki_alloc(char *str)
+void *seeki_alloc(struct d_info *dip, char *post)
{
+ char str[256];
struct seeki *sip = malloc(sizeof(struct seeki));
+ sprintf(str, "%s%s", dip->dip_name, post);
sip->rfp = seek_open(str, 'r');
sip->wfp = seek_open(str, 'w');
sip->cfp = seek_open(str, 'c');
@@ -222,8 +224,8 @@ void *seeki_alloc(char *str)
memset(&sip->sps, 0, sizeof(sip->sps));
- oname = malloc(strlen(sps_name) + strlen(str) + 32);
- sprintf(oname, "%s_%s.dat", sps_name, str);
+ oname = malloc(strlen(sps_name) + strlen(dip->dip_name) + 32);
+ sprintf(oname, "%s_%s.dat", sps_name, dip->dip_name);
if ((sip->sps_fp = my_fopen(oname, "w")) == NULL)
perror(oname);
else