commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r1152916 - /commons/proper/daemon/trunk/src/native/windows/src/log.c
Date Mon, 01 Aug 2011 20:13:29 GMT
Author: mturk
Date: Mon Aug  1 20:13:28 2011
New Revision: 1152916

URL: http://svn.apache.org/viewvc?rev=1152916&view=rev
Log:
Cleanup unused rotate code.

Modified:
    commons/proper/daemon/trunk/src/native/windows/src/log.c

Modified: commons/proper/daemon/trunk/src/native/windows/src/log.c
URL: http://svn.apache.org/viewvc/commons/proper/daemon/trunk/src/native/windows/src/log.c?rev=1152916&r1=1152915&r2=1152916&view=diff
==============================================================================
--- commons/proper/daemon/trunk/src/native/windows/src/log.c (original)
+++ commons/proper/daemon/trunk/src/native/windows/src/log.c Mon Aug  1 20:13:28 2011
@@ -32,7 +32,6 @@ static LPCSTR _log_level[] = {
 typedef struct apx_logfile_st {
     HANDLE      hFile;
     DWORD       dwLogLevel;
-    BOOL        bRotate;
     SYSTEMTIME  sysTime;
     WCHAR       szPath[SIZ_PATHLEN];
     WCHAR       szPrefix[MAX_PATH];
@@ -175,16 +174,6 @@ void apxLogLevelSet(HANDLE hFile, DWORD 
         lf->dwLogLevel = dwLevel;
 }
 
-void apxLogRotateSet(HANDLE hFile, BOOL doRotate)
-{
-    apx_logfile_st *lf = (apx_logfile_st *)hFile;
-    if (IS_INVALID_HANDLE(lf))
-        lf = _st_sys_loghandle;
-    if (IS_INVALID_HANDLE(lf))
-        return;
-    lf->bRotate = doRotate;
-}
-
 void apxLogLevelSetW(HANDLE  hFile,
                      LPCWSTR szLevel)
 {
@@ -206,36 +195,6 @@ void apxLogLevelSetW(HANDLE  hFile,
     }
 }
 
-static BOOL apx_log_rotate(apx_logfile_st *l,
-                           LPSYSTEMTIME lpCtime)
-{
-    WCHAR sPath[SIZ_PATHLEN];
-
-    /* rotate on daily basis */
-    if (l->sysTime.wDay == lpCtime->wDay)
-        return TRUE;
-    FlushFileBuffers(l->hFile);
-    CloseHandle(l->hFile);
-    l->sysTime = *lpCtime;
-
-    wsprintfW(sPath, L"%s\\%s"  LOGF_EXT,
-              l->szPath,
-              l->szPrefix,
-              l->sysTime.wYear,
-              l->sysTime.wMonth,
-              l->sysTime.wDay);
-    l->hFile =  CreateFileW(sPath,
-                      GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,
-                      NULL,
-                      OPEN_ALWAYS,
-                      FILE_FLAG_NO_BUFFERING | FILE_FLAG_SEQUENTIAL_SCAN,
-                      NULL);
-    if (IS_INVALID_HANDLE(l->hFile))
-        return FALSE;
-    else
-        return TRUE;
-}
-
 int
 apxLogWrite(
     HANDLE  hFile,
@@ -310,10 +269,6 @@ apxLogWrite(
         if (!IS_INVALID_HANDLE(lf->hFile)) {
             SYSTEMTIME t;
             GetLocalTime(&t);
-            if (lf->bRotate) {
-                if (!apx_log_rotate(lf, &t))
-                    return 0;
-            }
             if (dolock) {
                 APX_LOGLOCK(lf->hFile);
             }



Mime
View raw message