Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Don't close debug output file multiple times.

git-svn-id: https://xorp.svn.sourceforge.net/svnroot/xorp@409 26435e26-4b25-483a-942d-477236992e84
  • Loading branch information...
commit 0492216a034f6f638cedd207e6583681daa1a6b6 1 parent 1c2ad68
mjh authored
View
6 trunk/xorp/bgp/route_table_debug.cc
@@ -12,7 +12,7 @@
// notice is a summary of the XORP LICENSE file; the license in that file is
// legally binding.
-#ident "$XORP: xorp/bgp/route_table_debug.cc,v 1.3 2002/12/17 22:06:05 mjh Exp $"
+#ident "$XORP: xorp/bgp/route_table_debug.cc,v 1.4 2003/02/11 21:51:16 mjh Exp $"
//#define DEBUG_LOGGING
// #define DEBUG_PRINT_FUNCTION_NAME
@@ -34,7 +34,7 @@ DebugTable<A>::DebugTable(string table_name,
template<class A>
DebugTable<A>::~DebugTable() {
- if (_ofile != NULL)
+ if (_ofile != NULL && _close_on_delete)
fclose(_ofile);
}
@@ -210,12 +210,14 @@ DebugTable<A>::set_output_file(const string& filename) {
strerror(errno));
return false;
}
+ _close_on_delete = true;
return true;
}
template<class A>
void
DebugTable<A>::set_output_file(FILE *file) {
+ _close_on_delete = false;
_ofile = file;
}
View
3  trunk/xorp/bgp/route_table_debug.hh
@@ -12,7 +12,7 @@
// notice is a summary of the Xorp LICENSE file; the license in that file is
// legally binding.
-// $XORP: xorp/bgp/route_table_debug.hh,v 1.1.1.1 2002/12/11 23:55:50 hodson Exp $
+// $XORP: xorp/bgp/route_table_debug.hh,v 1.2 2002/12/17 22:06:05 mjh Exp $
#ifndef __BGP_ROUTE_TABLE_DEBUG_HH__
#define __BGP_ROUTE_TABLE_DEBUG_HH__
@@ -67,6 +67,7 @@ private:
int _canned_response;
int _msgs;
FILE *_ofile;
+ bool _close_on_delete;
bool _print_tablename;
};
Please sign in to comment.
Something went wrong with that request. Please try again.