make etherdump work again
authorNathan Binkert <binkertn@umich.edu>
Fri, 20 Feb 2004 20:19:19 +0000 (15:19 -0500)
committerNathan Binkert <binkertn@umich.edu>
Fri, 20 Feb 2004 20:19:19 +0000 (15:19 -0500)
dev/etherdump.cc:
    now that init is automatically called by the framework, don't
    init twice.

--HG--
extra : convert_revision : 16dcdef67aa193ed71ff546e7b255d60f39bf13d

dev/etherdump.cc

index 6d86adc324213724d565eeb971270be7f8f5271a..23b3d778e24e0163f4f370eccb436e69143162c2 100644 (file)
@@ -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);