summaryrefslogtreecommitdiff
path: root/dev
diff options
context:
space:
mode:
authorNathan Binkert <binkertn@umich.edu>2004-02-20 15:19:19 -0500
committerNathan Binkert <binkertn@umich.edu>2004-02-20 15:19:19 -0500
commitee8c8cbcd89f70d50a770007c6bcaf428ac2f233 (patch)
treefbe3e8c5af2bc8ef2fa54b32ae02716d699e5bb2 /dev
parent7ad5b6ee223ed5afbb8284da75be8f974331e0b5 (diff)
downloadgem5-ee8c8cbcd89f70d50a770007c6bcaf428ac2f233.tar.xz
make etherdump work again
dev/etherdump.cc: now that init is automatically called by the framework, don't init twice. --HG-- extra : convert_revision : 16dcdef67aa193ed71ff546e7b255d60f39bf13d
Diffstat (limited to 'dev')
-rw-r--r--dev/etherdump.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/dev/etherdump.cc b/dev/etherdump.cc
index 6d86adc32..23b3d778e 100644
--- a/dev/etherdump.cc
+++ b/dev/etherdump.cc
@@ -43,11 +43,8 @@ using std::string;
EtherDump::EtherDump(const string &name, const string &file)
: SimObject(name)
{
- if (!file.empty()) {
+ if (!file.empty())
stream.open(file.c_str());
- if (stream.is_open())
- init();
- }
}
#define DLT_EN10MB 1 // Ethernet (10Mb)
@@ -74,6 +71,9 @@ struct pcap_pkthdr {
void
EtherDump::init()
{
+ if (!stream.is_open())
+ return;
+
curtime = time(NULL);
s_freq = ticksPerSecond;
us_freq = ticksPerSecond / ULL(1000000);