bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Small bug in libnetfs


From: Marcus Brinkmann
Subject: Re: Small bug in libnetfs
Date: Wed, 20 Dec 2000 03:13:37 +0100
User-agent: Mutt/1.1.4i

On Tue, Dec 19, 2000 at 05:43:35PM -0700, Michael Oberg wrote:
> Shouldnt the patch read as follows?

> +  if (np == NULL)
> +    return ENOMEM;
> +

No, as netfs_make_node returns a void *, and not an error_t or something
like that. See for example a user in hostmux/hostmux.c:

  netfs_root_node = netfs_make_node (&root_nn);
  if (! netfs_root_node)
    error (5, ENOMEM, "Cannot create root node");

So you see, the NULL pointer returned is translated into an ENOMEM, just as
you expected that this should be the case somewhere.

Other places with a similar bug should indeed return ENOMEM. It depends on
the specification of the function (the return value, and what callers expect
to happen).

Thanks,
Marcus

-- 
`Rhubarb is no Egyptian god.' Debian http://www.debian.org brinkmd@debian.org
Marcus Brinkmann              GNU    http://www.gnu.org    marcus@gnu.org
Marcus.Brinkmann@ruhr-uni-bochum.de
http://www.marcus-brinkmann.de



reply via email to

[Prev in Thread] Current Thread [Next in Thread]