Date: Wed, 19 Jan 2000 11:53:42 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Laurynas Biveinis cc: DJGPP Workers Subject: Re: Patch: fchown() In-Reply-To: <3884B374.81D9DDF4@softhome.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp-workers AT delorie DOT com Errors-To: dj-admin AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk 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?