(file) Return to TraceFileHandlerPOSIX.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

Diff for /pegasus/src/Pegasus/Common/TraceFileHandlerPOSIX.cpp between version 1.16 and 1.17

version 1.16, 2008/12/16 18:56:00 version 1.17, 2008/12/19 10:17:10
Line 32 
Line 32 
 #if defined(PEGASUS_OS_VMS) #if defined(PEGASUS_OS_VMS)
 # include <fcntl.h> # include <fcntl.h>
 #endif #endif
 #include <Pegasus/Common/Logger.h>  
 #include <Pegasus/Common/System.h> #include <Pegasus/Common/System.h>
 #include <Pegasus/Common/TraceFileHandler.h> #include <Pegasus/Common/TraceFileHandler.h>
 #include <Pegasus/Common/Mutex.h> #include <Pegasus/Common/Mutex.h>
Line 78 
Line 77 
         if (!_fileHandle)         if (!_fileHandle)
         {         {
             // Unable to re-open file, log a message             // Unable to re-open file, log a message
               MessageLoaderParms parm(
             Logger::put_l(  
                 Logger::ERROR_LOG, System::CIMSERVER, Logger::WARNING,  
                 MessageLoaderParms(  
                     "Common.TraceFileHandlerUnix.FAILED_TO_OPEN_FILE",                     "Common.TraceFileHandlerUnix.FAILED_TO_OPEN_FILE",
                     "Failed to open File $0",                     "Failed to open File $0",
                     _fileName));                  _fileName);
               _logError(TRCFH_FAILED_TO_OPEN_FILE_SYSMSG,parm);
             return;             return;
         }         }
  
Line 93 
Line 90 
         if (!FileSystem::changeFilePermissions(         if (!FileSystem::changeFilePermissions(
                 String(_fileName), (S_IRUSR | S_IWUSR)))                 String(_fileName), (S_IRUSR | S_IWUSR)))
         {         {
             Logger::put_l(              MessageLoaderParms parm(
                 Logger::ERROR_LOG, System::CIMSERVER, Logger::WARNING,                  "Common.TraceFileHandlerUnix.FAILED_TO_SET_FILE_PERMISSIONS",
                 MessageLoaderParms(  
                     "Common.TraceFileHandlerUnix."  
                         "FAILED_TO_SET_FILE_PERMISSIONS",  
                     "Failed to set permissions on file $0",                     "Failed to set permissions on file $0",
                     _fileName));                  _fileName);
               _logError(TRCFH_FAILED_TO_SET_FILE_PERMISSIONS,parm);
             return;             return;
         }         }
     }     }
Line 128 
Line 123 
     retCode = fflush(_fileHandle);     retCode = fflush(_fileHandle);
     fileDesc = fileno(_fileHandle);     fileDesc = fileno(_fileHandle);
     retCode = fsync(fileDesc);     retCode = fsync(fileDesc);
     _wroteToLog = false;      if (retCode == 0)
     // retCode = fclose(_fileHandle);      {
     // _fileHandle = 0;          // trace message successful written, reset error log messages
           // thus allow writing of errors to log again
           _logErrorBitField = 0;
       }
  
     // ---- END CRITICAL SECTION     // ---- END CRITICAL SECTION
  
Line 153 
Line 151 
     retCode = fflush(_fileHandle);     retCode = fflush(_fileHandle);
     fileDesc = fileno(_fileHandle);     fileDesc = fileno(_fileHandle);
     retCode = fsync(fileDesc);     retCode = fsync(fileDesc);
     _wroteToLog = false;      if (retCode == 0)
     // retCode = fclose(_fileHandle);      {
     // _fileHandle = 0;          // trace message successful written, reset error log messages
           // thus allow writing of errors to log again
           _logErrorBitField = 0;
       }
  
     // ---- END CRITICAL SECTION     // ---- END CRITICAL SECTION
  
Line 199 
Line 200 
         if (!_fileHandle)         if (!_fileHandle)
         {         {
             // Unable to open file, log a message             // Unable to open file, log a message
             if (!_wroteToLog)              MessageLoaderParms parm(
             {  
                 Logger::put_l(  
                     Logger::ERROR_LOG, System::CIMSERVER, Logger::WARNING,  
                     MessageLoaderParms(  
                         "Common.TraceFileHandler.FAILED_TO_OPEN_FILE",                         "Common.TraceFileHandler.FAILED_TO_OPEN_FILE",
                         "Failed to open File $0",                         "Failed to open File $0",
                         _fileName));                  _fileName);
                 _wroteToLog = true;              _logError(TRCFH_FAILED_TO_OPEN_FILE_SYSMSG,parm);
             }  
             return;             return;
         }         }
     }     }
Line 241 
Line 237 
     fprintf(_fileHandle, "%s", message);     fprintf(_fileHandle, "%s", message);
     vfprintf(_fileHandle, fmt, argList);     vfprintf(_fileHandle, fmt, argList);
     fprintf(_fileHandle, "\n");     fprintf(_fileHandle, "\n");
     fflush(_fileHandle);      if (0 == fflush(_fileHandle))
       {
           // trace message successful written, reset error log messages
           // thus allow writing of errors to log again
           _logErrorBitField = 0;
       }
   
     // ---- END CRITICAL SECTION     // ---- END CRITICAL SECTION
 } }
  
Line 266 
Line 268 
     prepareFileHandle();     prepareFileHandle();
     // Write the message to the file     // Write the message to the file
     fprintf(_fileHandle, "%s\n", message);     fprintf(_fileHandle, "%s\n", message);
     fflush(_fileHandle);      if (0 == fflush(_fileHandle))
       {
           // trace message successful written, reset error log messages
           // thus allow writing of errors to log again
           _logErrorBitField = 0;
       }
     // ---- END CRITICAL SECTION     // ---- END CRITICAL SECTION
 } }
  


Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2