delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2002/05/04/00:20:35

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-workers-bounces using -f
From: sandmann AT clio DOT rice DOT edu (Charles Sandmann)
Message-Id: <10205040421.AA16488@clio.rice.edu>
Subject: Re: _open LFN & Win 2K Bug (Was Re: a bug)
To: acottrel AT ihug DOT com DOT au (Andrew Cottrell)
Date: Fri, 3 May 2002 23:21:01 -0500 (CDT)
Cc: djgpp-workers AT delorie DOT com
In-Reply-To: <001901c1f315$16566cb0$0102a8c0@acceleron> from "Andrew Cottrell" at May 04, 2002 12:39:36 PM
X-Mailer: ELM [version 2.5 PL2]
Mime-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> I thought about modifying doserr_to_errno and the modifiaction may not be
> the best place to put the change as the modifiaction to the table will then
> propogate to all dos errors to errno conversions. 

I think doserr_to_errno is the right place, since other opens with strange
characters other places in libc should also get the correct translation.
According to RB's list, 123 (7b) is invalid character or file system 
name ... when it comes to an open statement I think it's reasonable that
it be re-mapped to the "not found" errno.

> I spotted one other potential problem when testing this solution and found
> the following:-
>     In open() after calling _opne() there is a call to
> __file_exists(real_name) which sometimes changes the _doserrno. This causes
> differences between LFN=y and LFN=y results when printing _doserrno, errno
> does not get changed. Is this a bug or a quirk?

A quirk?  Many places in libc we save/restore errno but don't futz with
_doserrno.  It's a little known feature which is useful for quick debugging
like I did in the example - but you may need to look at the source if it
doesn't do what you think it should.

- Raw text -


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