Return-Path: Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: (qmail 71721 invoked from network); 21 Feb 2010 06:44:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 21 Feb 2010 06:44:47 -0000 Received: (qmail 52178 invoked by uid 500); 21 Feb 2010 06:44:46 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 52066 invoked by uid 500); 21 Feb 2010 06:44:46 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 52055 invoked by uid 99); 21 Feb 2010 06:44:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 21 Feb 2010 06:44:45 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 21 Feb 2010 06:44:45 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 22218238890A; Sun, 21 Feb 2010 06:44:25 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r912303 - /tomcat/jk/trunk/native/common/jk_util.c Date: Sun, 21 Feb 2010 06:44:25 -0000 To: dev@tomcat.apache.org From: mturk@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100221064425.22218238890A@eris.apache.org> Author: mturk Date: Sun Feb 21 06:44:24 2010 New Revision: 912303 URL: http://svn.apache.org/viewvc?rev=912303&view=rev Log: Lock the file during logging so that mutiple processes can write safely Modified: tomcat/jk/trunk/native/common/jk_util.c Modified: tomcat/jk/trunk/native/common/jk_util.c URL: http://svn.apache.org/viewvc/tomcat/jk/trunk/native/common/jk_util.c?rev=912303&r1=912302&r2=912303&view=diff ============================================================================== --- tomcat/jk/trunk/native/common/jk_util.c (original) +++ tomcat/jk/trunk/native/common/jk_util.c Sun Feb 21 06:44:24 2010 @@ -542,9 +542,17 @@ if (p->logfile) { what[used++] = '\n'; what[used] = '\0'; +#if defined(WIN32) && defined(_MSC_VER) + LockFile((HANDLE)_get_osfhandle(_fileno(p->logfile)), + 0, 0, 1, 0); +#endif fputs(what, p->logfile); /* [V] Flush the dam' thing! */ fflush(p->logfile); +#if defined(WIN32) && defined(_MSC_VER) + UnlockFile((HANDLE)_get_osfhandle(_fileno(p->logfile)), + 0, 0, 1, 0); +#endif } return JK_TRUE; } @@ -627,6 +635,8 @@ rc->logger_private = p; #if defined(AS400) && !defined(AS400_UTF8) p->logfile = fdopen(fd, "a+, o_ccsid=0"); +#elif defined(WIN32) && defined(_MSC_VER) + p->logfile = fdopen(fd, "a+c"); #else p->logfile = fdopen(fd, "a+"); #endif --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org