commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r1003794 - /commons/proper/daemon/trunk/src/native/windows/src/log.c
Date Sat, 02 Oct 2010 13:21:46 GMT
Author: mturk
Date: Sat Oct  2 13:21:46 2010
New Revision: 1003794

URL: http://svn.apache.org/viewvc?rev=1003794&view=rev
Log:
Create a LogFile f they don't exist

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=1003794&r1=1003793&r2=1003794&view=diff
==============================================================================
--- commons/proper/daemon/trunk/src/native/windows/src/log.c (original)
+++ commons/proper/daemon/trunk/src/native/windows/src/log.c Sat Oct  2 13:21:46 2010
@@ -112,7 +112,16 @@ HANDLE apxLogOpen(
     if (!szPath) {
         if (GetSystemDirectoryW(sPath, MAX_PATH) == 0)
             return INVALID_HANDLE_VALUE;
-        lstrlcatW(sPath, MAX_PATH, L"\\LogFiles\\Apache");
+        lstrlcatW(sPath, MAX_PATH, L"\\LogFiles");
+        if (!CreateDirectoryW(sPath, NULL) && GetLastError() != ERROR_ALREADY_EXISTS)
{
+            if (!CreateDirectoryW(sPath, NULL))
+                return INVALID_HANDLE_VALUE;
+        }
+        lstrlcatW(sPath, MAX_PATH, L"\\Apache");
+        if (!CreateDirectoryW(sPath, NULL) && GetLastError() != ERROR_ALREADY_EXISTS)
{
+            if (!CreateDirectoryW(sPath, NULL))
+                return INVALID_HANDLE_VALUE;
+        }
     }
     else {
         lstrlcpyW(sPath, MAX_PATH, szPath);



Mime
View raw message