Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sourceware.cygnus.com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin@sourceware.cygnus.com>
List-Help: <mailto:cygwin-help@sourceware.cygnus.com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner@sourceware.cygnus.com
Delivered-To: mailing list cygwin@sourceware.cygnus.com
Message-Id: <200003150530.AAA24404@mail.bcpl.net>
From: "J. David Bryan" <dbryan@bcpl.net>
Organization: Palomar Corporation
To: cygwin@sourceware.cygnus.com
Date: Wed, 15 Mar 2000 00:30:41 -0500
MIME-Version: 1.0
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7BIT
Subject: Re: Permission denied with makeinfo from texinfo-4.0
In-reply-to: <20000315000856.C3982@cygnus.com>
References: <200003150435.XAA12288@mail.bcpl.net>; from dbryan@bcpl.net on Tue, Mar 14, 2000 at 11:35:37PM -0500
X-mailer: Pegasus Mail for Win32 (v3.12c)

On 15 Mar 2000, at 0:08, Chris Faylor wrote:

> Defining -DWIN32 is not usually a good idea.  It usually causes packages
> to use windows specific code and workarounds which are not necessary for
> cygwin. 

Generally sound advice.  However, in this case, -DWIN32 changes the 
behavior of only file (files.c) of the makeinfo source.  It does two 
things:

 * It works around the bug mentioned, albeit by reading the source file a
   character at a time instead of all in one go.

 * It does not use $HOME as a search path for texinfo files.

The intent of my workaround was to avoid the buffer problem in makeinfo 
without changing the source.  The proper solution, of course, is to fix the 
error causing the invalid buffer to be passed to "read".


> Is it possible to provide a little more pinpoint control to get the
> files opened with O_BINARY?
> 
> Usually I do something like this:
> 
> #ifndef O_BINARY
> #define O_BINARY 0
> #endif
> 
> .
> .
> .
>   open("foo", O_CREATE|O_TRUNC|O_BINARY);

To avoid the problem, O_BINARY must be undefined, not simply zero.  
Undefining it will avoid the invalid buffer (by compiling different code) 
at the cost of losing the ability to process texinfo files containing 
Windows line ends.

For anyone interested, the problem lines are in makeinfo/files.c, lines 167-
185.

                                      -- Dave Bryan

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

