Fix EventSource default channel allocation (#48864)
authorSung Yoon Whang <suwhang@microsoft.com>
Mon, 24 May 2021 20:42:52 +0000 (13:42 -0700)
committerGitHub <noreply@github.com>
Mon, 24 May 2021 20:42:52 +0000 (13:42 -0700)
src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs

index 0492071dba4a34962456bda728d61ac91d90ba61..919839f0d42fbb6fe4bb8085e67080c149def63d 100644 (file)
@@ -5486,7 +5486,7 @@ namespace System.Diagnostics.Tracing
             if (!channelTab.TryGetValue((int)channel, out ChannelInfo? info))
             {
                 // If we were not given an explicit channel, allocate one.
-                if (channelKeyword != 0)
+                if (channelKeyword == 0)
                 {
                     channelKeyword = nextChannelKeywordBit;
                     nextChannelKeywordBit >>= 1;