btt: better data file naming
[blktrace.git] / btt / aqd.c
index 3a451616952cb43e5e1c28f96f40f3a339d47455..3bb6f8521f0c7935860ff562bf1a0819d6fb6a0a 100644 (file)
--- a/btt/aqd.c
+++ b/btt/aqd.c
@@ -29,7 +29,7 @@ struct aqd_info {
        int na;         /* # active */
 };
 
-void *aqd_alloc(char *str)
+void *aqd_alloc(struct d_info *dip)
 {
        char *oname;
        struct aqd_info *ap;
@@ -39,8 +39,8 @@ void *aqd_alloc(char *str)
        ap = malloc(sizeof(*ap));
        ap->na = 0;
 
-       oname = malloc(strlen(aqd_name) + strlen(str) + 32);
-       sprintf(oname, "%s_%s.dat", aqd_name, str);
+       oname = malloc(strlen(aqd_name) + strlen(dip->dip_name) + 32);
+       sprintf(oname, "%s_%s_aqd.dat", aqd_name, dip->dip_name);
        if ((ap->fp = my_fopen(oname, "w")) == NULL) {
                perror(oname);
                return NULL;