delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/08/05/16:39:22

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
In-Reply-To: <1Qoug4-1GulCy0@fwd17.aul.t-online.de>
References: <1Qoug4-1GulCy0 AT fwd17 DOT aul DOT t-online DOT de>
Date: Fri, 5 Aug 2011 21:38:54 +0100
Message-ID: <CAHWeT-YaTX+dg=Ldf=7s4DfuVwnNFbJSOuZ9oAeCdir+s7x9_g@mail.gmail.com>
Subject: Re: mintty --log overwrites existing logfile in place
From: Andy Koppe <andy DOT koppe AT gmail DOT com>
To: Christian Franke <Christian DOT Franke AT t-online DOT de>, cygwin AT cygwin DOT com
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT 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
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id p75KdJH6014152

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:

D'oh!

> mintty-1.0.1/child.c:
>  // Open log file if any
>  if (*cfg.log) {
>    log_fd = open(cfg.log, O_WRONLY | O_CREAT, 0600);
>    if (log_fd < 0)
>      error("open log file");
>  }
>
> Then it is sometimes difficult to determine where the new log output
> ends :-)
>
> I would suggest to add O_APPEND.

I'll ponder that. The original intention was O_TRUNC.

Thanks,
Andy

--
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