]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/filelogger.cpp
Fix for bug #376 - FEATURE - (sorry w00t) - not backporting to stable.
[user/henk/code/inspircd.git] / src / filelogger.cpp
index 5fcd58f150bf44f7a73d30eef4e7ba40c505e3bf..8bd28dde8f925191531f0ea0374da75a07affedb 100644 (file)
@@ -11,8 +11,7 @@
  * ---------------------------------------------------
  */
 
-#include <time.h>
-#include <string>
+#include "inspircd.h"
 #include <sstream>
 #include <fstream>
 #include "socketengine.h"
@@ -24,7 +23,7 @@ FileLogger::FileLogger(InspIRCd* Instance, FILE* logfile)
 {
        if (log)
        {
-               irc::sockets::NonBlocking(fileno(log));
+               Instance->SE->NonBlocking(fileno(log));
                SetFd(fileno(log));
                buffer.clear();
        }
@@ -80,13 +79,8 @@ void FileLogger::Close()
 {
        if (log)
        {
-               /* Burlex: Windows assumes nonblocking on FILE* pointers anyway, and also "file" fd's aren't the same
-                * as socket fd's.
-                */
-#ifndef WIN32
-               int flags = fcntl(fileno(log), F_GETFL, 0);
-               fcntl(fileno(log), F_SETFL, flags ^ O_NONBLOCK);
-#endif
+               ServerInstance->SE->Blocking(fileno(log));
+
                if (buffer.size())
                        fprintf(log,"%s",buffer.c_str());