delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/01/07/15:57:00

From: lauras AT softhome DOT net
Date: Sun, 7 Jan 2001 22:55:57 +0200
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
Cc: lauras AT softhome DOT net, djgpp-workers AT delorie DOT com,
rich AT phekda DOT freeserve DOT co DOT uk
Subject: Re: Bug in lstat() - wrong arguments to FSEXT
Message-ID: <20010107225557.A210@lauras.lt>
References: <20010107141016 DOT A314 AT lauras DOT lt> <Pine DOT SUN DOT 3 DOT 91 DOT 1010107141348 DOT 25836D-100000 AT is> <20010107155532 DOT A4259 AT lauras DOT lt> <9003-Sun07Jan2001194450+0200-eliz AT is DOT elta DOT co DOT il>
Mime-Version: 1.0
User-Agent: Mutt/1.2.5i
In-Reply-To: <9003-Sun07Jan2001194450+0200-eliz@is.elta.co.il>; from eliz@is.elta.co.il on Sun, Jan 07, 2001 at 07:44:51PM +0200
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

--PNTmBPCT7hxwcZjr
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Sun, Jan 07, 2001 at 07:44:51PM +0200, Eli Zaretskii wrote:
>      if (!__solve_dir_symlinks(path, real_path))
>        return -1;
 
>    static int try_fsext (int *ret, const char *path, struct stat *statbuf)
>    {
>      return __FSEXT_call_open_handlers (__FSEXT_stat, ret, &path);
>    }
 
Why are you passing statbuf arg here? Where it is used? Am I
missing something?

I've made a patch without this arg. It is attached and waiting
for comments.

Laurynas


--PNTmBPCT7hxwcZjr
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="lstat.c.diff"

Index: lstat.c
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/posix/sys/stat/lstat.c,v
retrieving revision 1.3
diff -u -r1.3 lstat.c
--- lstat.c	2000/08/25 11:39:49	1.3
+++ lstat.c	2001/01/07 20:50:53
@@ -1,3 +1,4 @@
+/* Copyright (C) 2001 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 2000 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 1999 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
@@ -872,6 +873,15 @@
   return 0;
 }
 
+/* A wrapper around __FSEXT_call_open_handlers(), to provide its
+ * arguments properly.
+ */
+static inline int fsext_wrapper(int * ret, const char * path)
+{
+   return __FSEXT_call_open_handlers(__FSEXT_stat, ret, &path);
+}
+
+
 /* Main entry point.  This is library lstat() function.
  */
 
@@ -907,8 +917,8 @@
       return -1;
     }
 
-  if (__FSEXT_call_open_handlers(__FSEXT_stat, &ret, &real_path))
-   return ret;
+  if (fsext_wrapper(&ret, real_path))
+    return ret;
 
   if (stat_assist(real_path, statbuf) == -1)
     {

--PNTmBPCT7hxwcZjr--

- Raw text -


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