Error checking for g_mod_event() and friends

Lukas Ertl l.ertl at univie.ac.at
Tue Jan 27 07:02:12 PST 2004


On Tue, 27 Jan 2004, Poul-Henning Kamp wrote:

> In message <20040127154303.E92925 at pcle2.cc.univie.ac.at>, Lukas Ertl writes:
> >Hi,
> >
> >is there a specific reason that the .init function of a class is declared
> >to return "void"?  I'd like to change that to an int, so we could do error
> >checking, and subsequently modify g_load_class() to check for errors and
> >so on.
>
> In what circumstances would class->init() fail ?

In the geom_vinum case I allocate the "main" vinum geom in the init
method, and this might fail.

(Of course, this might not be the correct way to do it, but I couldn't
think of another way.)

> >Additionally, I've seen several calls to g_malloc() where the return
> >values aren't checked - should I prepare some patches for these?
>
> yes please.

Ok.

regards,
le

-- 
Lukas Ertl                             eMail: l.ertl at univie.ac.at
UNIX Systemadministrator               Tel.:  (+43 1) 4277-14073
Vienna University Computer Center      Fax.:  (+43 1) 4277-9140
University of Vienna                   http://mailbox.univie.ac.at/~le/


More information about the freebsd-geom mailing list