Mail Archives: djgpp-workers/2001/01/08/03:30:25
--4Ckj6UjgE2iN1+kY
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
On Mon, Jan 08, 2001 at 12:41:23AM +0200, Eli Zaretskii wrote:
> The way it works is that the hook gets a pointer to its first argument
> on the stack, and then it walks the stack with va_arg to get the rest.
> The same is done in the open hook: it only gets the pointer to the
> first argument, but it also needs the open mode.
OK. Sorry for asking such trivial questions. Anyway, here
is an updated patch.
Laurynas
--4Ckj6UjgE2iN1+kY
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/08 07:41:25
@@ -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,16 @@
return 0;
}
+/* A wrapper around __FSEXT_call_open_handlers(), to provide its
+ * arguments properly.
+ */
+static int fsext_wrapper(int * ret, const char * path,
+ struct stat * statbuf __attribute__((unused)))
+{
+ return __FSEXT_call_open_handlers(__FSEXT_stat, ret, &path);
+}
+
+
/* Main entry point. This is library lstat() function.
*/
@@ -907,8 +918,8 @@
return -1;
}
- if (__FSEXT_call_open_handlers(__FSEXT_stat, &ret, &real_path))
- return ret;
+ if (fsext_wrapper(&ret, real_path, statbuf))
+ return ret;
if (stat_assist(real_path, statbuf) == -1)
{
--4Ckj6UjgE2iN1+kY--
- Raw text -