From 18e402ddc85bb5b73f619e27bdd41bf5d445d324 Mon Sep 17 00:00:00 2001 From: steve Date: Sun, 17 Nov 2002 22:28:42 +0000 Subject: [PATCH] Close old file if $dumpfile is called again. --- vpi/sys_lxt.c | 8 +++++++- vpi/sys_vcd.c | 10 +++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/vpi/sys_lxt.c b/vpi/sys_lxt.c index 24ddecd6a..0564d0519 100644 --- a/vpi/sys_lxt.c +++ b/vpi/sys_lxt.c @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: sys_lxt.c,v 1.11 2002/08/15 02:12:20 steve Exp $" +#ident "$Id: sys_lxt.c,v 1.12 2002/11/17 22:28:42 steve Exp $" #endif # include "config.h" @@ -460,6 +460,9 @@ static int sys_dumpfile_calltf(char*name) path = strdup("dumpfile.lxt"); } + if (dump_file) + close_dumpfile(); + assert(dump_file == 0); open_dumpfile(path); @@ -814,6 +817,9 @@ void sys_lxt_register() /* * $Log: sys_lxt.c,v $ + * Revision 1.12 2002/11/17 22:28:42 steve + * Close old file if $dumpfile is called again. + * * Revision 1.11 2002/08/15 02:12:20 steve * add dumpvars_compiletf to check first argument. * diff --git a/vpi/sys_vcd.c b/vpi/sys_vcd.c index 0af8cb99a..98a437039 100644 --- a/vpi/sys_vcd.c +++ b/vpi/sys_vcd.c @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: sys_vcd.c,v 1.38 2002/11/14 22:43:58 steve Exp $" +#ident "$Id: sys_vcd.c,v 1.39 2002/11/17 22:28:42 steve Exp $" #endif # include "config.h" @@ -449,6 +449,11 @@ static int sys_dumpfile_calltf(char*name) path = strdup("dumpfile.vcd"); } + if (dump_file) { + fclose(dump_file); + dump_file = 0; + } + assert(dump_file == 0); open_dumpfile(path); @@ -844,6 +849,9 @@ void sys_vcd_register() /* * $Log: sys_vcd.c,v $ + * Revision 1.39 2002/11/17 22:28:42 steve + * Close old file if $dumpfile is called again. + * * Revision 1.38 2002/11/14 22:43:58 steve * Save vpiFullName results. *