delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2000/01/19/06:03:10

Date: Wed, 19 Jan 2000 11:53:42 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Laurynas Biveinis <lauras AT softhome DOT net>
cc: DJGPP Workers <djgpp-workers AT delorie DOT com>
Subject: Re: Patch: fchown()
In-Reply-To: <3884B374.81D9DDF4@softhome.net>
Message-ID: <Pine.SUN.3.91.1000119115250.9609S-100000@is>
MIME-Version: 1.0
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

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 -


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