X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,UNPARSEABLE_RELAY X-Spam-Check-By: sourceware.org Message-ID: <4E3D1981.7040208@t-online.de> Date: Sat, 06 Aug 2011 12:37:53 +0200 From: Christian Franke User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: mintty --log overwrites existing logfile in place References: <1Qoug4-1GulCy0 AT fwd17 DOT aul DOT t-online DOT de> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Csaba Raduly wrote: > On Fri, Aug 5, 2011 at 10:38 PM, Andy Koppe wrote: > >> On 4 August 2011 10:57, Christian Franke wrote: >> >>> The mintty --log option is very useful but opens logfile without O_TRUNC >>> or O_APPEND: >>> > (snip) > >>> I would suggest to add O_APPEND. >>> >> I'll ponder that. The original intention was O_TRUNC. >> >> > Ideally it could be made user-selectable. > Agree, e.g. "--log +FILE" appends to FILE: client.c: // Open log file if any if (*cfg.log) { if (cfg.log[0] == '+' && cfg.log[1]) log_fd = open(cfg.log+1, O_WRONLY | O_CREAT | O_APPEND, 0600); else log_fd = open(cfg.log, O_WRONLY | O_CREAT | O_TRUNC, 0600); if (log_fd < 0) error("open log file"); } Thanks, Christian -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple