Address PR feedback on ETW disablement on Unix
authorStephen Toub <stoub@microsoft.com>
Thu, 12 Feb 2015 01:11:56 +0000 (20:11 -0500)
committerStephen Toub <stoub@microsoft.com>
Thu, 12 Feb 2015 01:11:56 +0000 (20:11 -0500)
src/mscorlib/src/System/Diagnostics/Eventing/EventSource.cs

index 0da69b9..c6c3de8 100644 (file)
@@ -2582,13 +2582,13 @@ namespace System.Diagnostics.Tracing
             {
 #if FEATURE_MANAGED_ETW
                 if (m_provider != null && m_provider.IsValid())
+#endif // FEATURE_MANAGED_ETW
                 {
                     // When the ETW session is created after the EventSource has registered with the ETW system
                     // we can send any error messages here.
                     ReportOutOfBandMessage("ERROR: Exception during SendCommand for EventSource " +
                                             Name + ": " + e.Message, true);
                 }
-#endif // FEATURE_MANAGED_ETW
 
                 // When the EventSource is created while an ETW session already exists, the registration has not 
                 // completed yet, and m_provider does not have a valid registration handle, so we'll remember 
@@ -2769,7 +2769,7 @@ namespace System.Diagnostics.Tracing
 #if FEATURE_MANAGED_ETW
             get { return m_provider == null || m_provider.m_disposed; }
 #else
-            get { return true; }
+            get { return false; } // ETW is not present (true means that the EventSource is "off" / broken)
 #endif // FEATURE_MANAGED_ETW
         }