dpsenner commented on a change in pull request #48: Fixes LOG4NET-587 Mutex ~ 
UnauthorizedAccessException Access to the path is denied
URL: https://github.com/apache/logging-log4net/pull/48#discussion_r287853544
 
 

 ##########
 File path: src/Appender/RollingFileAppender.cs
 ##########
 @@ -1147,8 +1148,20 @@ override public void ActivateOptions()
                        }
 
 #if !NETCF
-                       // initialize the mutex that is used to lock rolling
-                       m_mutexForRolling = new Mutex(false, 
m_baseFileName.Replace("\\", "_").Replace(":", "_").Replace("/", "_"));
+                       if (m_mutexForRolling == null)
+                       {
+                               // initialize the mutex that is used to lock 
rolling
+                               string mutexFriendlyFilename = 
m_baseFileName.Replace("\\", "_").Replace(":", "_").Replace("/", "_");
 
 Review comment:
   I am unsure whether the application still behaves well. Mutex names are not 
a path or a file name.
   
   This exists to guess a mostly unique mutex name from the filename. This way 
another rolling file appender configured to roll another filename can happily 
roll at the same time.
   
   So long this is preserved the code can do anything. Even md5 hashing would 
be ok.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to