Skip to content

Commit

Permalink
Remove Logger_File mutex
Browse files Browse the repository at this point in the history
This is not providing protection for all of the logging, so it gives a
false sense of security. We're also not making use of this as we have
barely any threading.

The exception is the WinVNC code, which is very thread heavy. But it is
unmaintained and will not be a blocker for this.
  • Loading branch information
CendioOssman committed Jan 6, 2025
1 parent 8097619 commit 7fe505c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
6 changes: 0 additions & 6 deletions common/rfb/Logger_file.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
#include <stdlib.h>
#include <string.h>

#include <os/Mutex.h>

#include <rfb/Logger_file.h>

using namespace rfb;
Expand All @@ -37,19 +35,15 @@ Logger_File::Logger_File(const char* loggerName)
m_lastLogTime(0)
{
m_filename[0] = '\0';
mutex = new os::Mutex();
}

Logger_File::~Logger_File()
{
closeFile();
delete mutex;
}

void Logger_File::write(int /*level*/, const char *logname, const char *message)
{
os::AutoMutex a(mutex);

if (!m_file) {
if (m_filename[0] == '\0')
return;
Expand Down
3 changes: 0 additions & 3 deletions common/rfb/Logger_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@

#include <rfb/Logger.h>

namespace os { class Mutex; }

namespace rfb {

class Logger_File : public Logger {
Expand All @@ -47,7 +45,6 @@ namespace rfb {
char m_filename[PATH_MAX];
FILE* m_file;
time_t m_lastLogTime;
os::Mutex* mutex;
};

bool initFileLogger(const char* filename);
Expand Down

0 comments on commit 7fe505c

Please sign in to comment.