Mail Archives: djgpp-workers/2000/01/19/06:03:10
On Tue, 18 Jan 2000, Laurynas Biveinis wrote:
> I've implemented it and updated docs.
Thanks!
> FSEXT hook is also included, pleases check if it is correct.
Almost; see below.
> --- djgpp.old/include/libc/stubs.h Mon Sep 8 01:07:18 1997
> +++ djgpp/include/libc/stubs.h Sun Jan 9 15:06:58 2000
> @@ -36,6 +36,7 @@
> #define crlf2nl __crlf2nl
> #define dosmemget __dosmemget
> #define dosmemput __dosmemput
> +#define fchown __fchown
Why did you need to add this? This is only required if some ANSI or
Posix function calls fchown. I don't think this is the case.
> +int
> +fchown(int fd, uid_t owner, gid_t group)
> +{
> + __FSEXT_Function * func = __FSEXT_get_function(fd);
> + if (func)
> + {
> + int rv;
> + if (func(__FSEXT_read, &rv, &handle))
^^^^^^^^^^^^
This should have been __FSEXT_fchown ;-).
> + return rv;
> + }
> + return 0;
I thought you wanted to check that the handle is valid, no? As
written, this will succeed for any value passed as FD, even if it is
65535 or -1. Is that a good idea?
- Raw text -