delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2011/07/02/04:38:59

X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f
X-Recipient: djgpp-workers AT delorie DOT com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=gamma;
h=mime-version:date:message-id:subject:from:to:content-type;
bh=piMihaEzBEDKPvE72hEI+sgMMANKuiDK5HY+C4fZhCc=;
b=uTr4Lv/1I5tFyS3AQCYO7II6gOBo+yfUK71Cz8PCZZQWCY+034AC4P670UvdTLXoNW
cqXU+OoCV7ixCHKod74nN8BECGrVOAIy4Jk7RbndNf8Wv6P1yCpvkLqqpk71J3FzLPOQ
pix7iYXhXaAq27Fzef5jCavSkDQM6m0IFYslA=
MIME-Version: 1.0
Date: Sat, 2 Jul 2011 11:38:29 +0300
Message-ID: <BANLkTikONeSs9a4yssD3CRBXbGe2Meygng@mail.gmail.com>
Subject: [patch] make _dos_getfileattr to return r.x.cx
From: Ozkan Sezer <sezeroz AT gmail DOT com>
To: djgpp-workers AT delorie DOT com
Reply-To: djgpp-workers AT delorie DOT com

On Wed, Jun 8, 2011 at 3:37 AM, DJ Delorie <dj AT delorie DOT com> wrote:
>
> ------- Start of forwarded message -------
> Date: Tue, 7 Jun 2011 20:13:01 -0400 (EDT)
> From: David Winfrey <dlw AT patriot DOT net>
> To: dj AT delorie DOT com
> Subject: Possible bug in _dos_getfileattr
> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
>
>
> I believe that _dos_getfileattr(),
> in src\libc\dos\compat\d_getfa.c in the gcc452b.zip file,
> needs to return r.x.cx instead of r.x.ax.
>
> It's consistently returning 0x4300, regardless of the
> actual file attributes; this is the r.x.ax input value
> for the DOS get_attributes call.
>
> Thanks,
>
> David L. Winfrey
> dlw AT patriot DOT net
> www.patriot.net/users/dlw
> www.wsumc.net
> ------- End of forwarded message -------
>

The patch below is after the above bug report from the
thread above.  The lfn-aware version _chmod() returns r.x.cx
too, so the suggestion seems valid, hence the suggested
patch.

Regards.

Index: d_getfa.c
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/dos/compat/d_getfa.c,v
retrieving revision 1.1
diff -U 7 -p -r1.1 d_getfa.c
--- d_getfa.c	25 Nov 1995 02:18:00 -0000	1.1
+++ d_getfa.c	2 Jul 2011 08:33:24 -0000
@@ -31,10 +31,10 @@ unsigned int _dos_getfileattr(const char
   r.x.ds = __tb / 16;
   __dpmi_int(0x21, &r);
   if ( r.x.flags & 1 )
   {
     errno = __doserr_to_errno(r.x.ax);
     return r.x.ax;
   }
-  *p_attr = r.x.ax;
+  *p_attr = r.x.cx;
   return 0;
 }


--
O.S.

- Raw text -


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