delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2003/01/30/15:56:19

Date: Thu, 30 Jan 2003 20:58:04 +0000
From: "Richard Dawe" <rich AT phekda DOT freeserve DOT co DOT uk>
Sender: rich AT phekda DOT freeserve DOT co DOT uk
To: djgpp-workers AT delorie DOT com
X-Mailer: Emacs 21.3.50 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.6
Subject: __internal_readlink & findfirst: attributes? [PATCH]
Message-Id: <E18eLjJ-0000oQ-00@phekda.freeserve.co.uk>
Reply-To: djgpp-workers AT delorie DOT com

Hello.

Currently we call findfirst from __internal_readlink with the attributes
set to 0. I think we should pass in some combination of the FA_* bits.
The patch below passes in FA_RDONLY|FA_ARCH. I know these bits
are ignored by the INT 21h subfunction that's used by findfirst,
but I think we should pass them in, because:

(a) it shows what we mean to do;
(b) it won't break if something does ever support those bits.

OK to commit?

Bye, Rich =]

Index: src/libc/compat/unistd/_irdlink.c
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/compat/unistd/_irdlink.c,v
retrieving revision 1.7
diff -p -u -3 -r1.7 _irdlink.c
--- src/libc/compat/unistd/_irdlink.c	29 Dec 2002 05:59:00 -0000	1.7
+++ src/libc/compat/unistd/_irdlink.c	30 Jan 2003 20:53:31 -0000
@@ -1,3 +1,4 @@
+/* Copyright (C) 2003 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 2002 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 2001 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 2000 DJ Delorie, see COPYING.DJ for details */
@@ -44,7 +45,7 @@ int __internal_readlink(const char * __p
 					     __path, __buf, __max))
          return ret;
       /* We will check if file exists by the way */
-      if (findfirst(__path, &file_info, 0))
+      if (findfirst(__path, &file_info, FA_RDONLY|FA_ARCH))
       {
          errno = ENOENT;
          return -1;

- Raw text -


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