delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/08/06/06:38:24

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 <Christian DOT Franke AT t-online DOT de>
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> <CAHWeT-YaTX+dg=Ldf=7s4DfuVwnNFbJSOuZ9oAeCdir+s7x9_g AT mail DOT gmail DOT com> <CAEhDDbBbr_EftvgFJOegvTS4VPdjDR2X_tSeFKb=KCtcYqEV3Q AT mail DOT gmail DOT com>
In-Reply-To: <CAEhDDbBbr_EftvgFJOegvTS4VPdjDR2X_tSeFKb=KCtcYqEV3Q@mail.gmail.com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019