X-Recipient: archive-cygwin@delorie.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@fwd17.aul.t-online.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.koppe@gmail.com>
To: Christian Franke <Christian.Franke@t-online.de>, cygwin@cygwin.com
Content-Type: text/plain; charset=UTF-8
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Content-Transfer-Encoding: 8bit
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


