[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Freeipmi-devel] xmalloc
From: |
Albert Chu |
Subject: |
Re: [Freeipmi-devel] xmalloc |
Date: |
Tue, 30 Dec 2003 11:58:54 -0800 |
> We can write a local XMALLOC which sets ENOMEM and calls return or
> exit with failure.
I just don't like the idea of a library outputting things to
stdout/stderr all of a sudden (see fixup_null_alloc in xmalloc.c).
In addition, right now you don't check the return value within FreeIPMI
when you call xmalloc(), so there are segfault possibilities.
I think we should return to the user let the user deal with it.
> I will make the release of lan-fiid today.
Cool. I am nearing the point that I am extremely happy with ipmipower.
The only things I think need to be done are md2/md5 within FreeIPMI and
a per-message-authentication option for ipmipower, which can't be done
with the libfreeipmi-alpha1 snapshot (barring some insane re-write/hacks).
Al
--
Albert Chu
address@hidden
Lawrence Livermore National Laboratory
----- Original Message -----
From: Anand Babu <address@hidden>
Date: Tuesday, December 30, 2003 11:27 am
Subject: Re: [Freeipmi-devel] xmalloc
> Purpose of xmalloc is to check the return value of malloc. C does not
> have any exception handling facility. Code for error handling can grow
> more than the actual code if all return values are checked.
>
> When the library does not have enough memory to complete the operation
> successfully, what should it do.
>
> We can write a local XMALLOC which sets ENOMEM and calls return or
> exit with failure.
>
> I will make the release of lan-fiid today.
>
> -ab
>
> ,----[ Albert Chu <address@hidden> ]
> | Hey AB,
> |
> | I just noticed. A message will fprintf to stderr when the system
> runs| out of memory. I don't think we want this for a library.
> Shouldn't| we return errno = ENOMEM??
> `----
>
> --
> _.|_
> (_||_)
> Free as in Freedom <www.gnu.org>
>