[sheepdog] [PATCH V2] Replace malloc with xmalloc
harryxiyou
harryxiyou at gmail.com
Fri Feb 22 18:15:09 CET 2013
On Fri, Feb 22, 2013 at 10:04 PM, MORITA Kazutaka
<morita.kazutaka at gmail.com> wrote:
> At Fri, 22 Feb 2013 16:32:40 +0800,
> harryxiyou at gmail.com wrote:
>>
>> From: Harry Wei <harryxiyou at gmail.com>
>>
>> This patch replaces malloc with xmalloc for simplicity.
>> It also catches SIGABRT to exit with EXIT_SYSFAIL in
>> the case of out of memory.
>>
>> Signed-off-by: Harry Wei <harryxiyou at gmail.com>
>> ---
>> collie/collie.c | 21 ++++++++++++++++++++-
>> 1 file changed, 20 insertions(+), 1 deletion(-)
>
> Your patch is against collie, so subject line should be
>
> collie: replace malloc with xmalloc
>
> I've pushed this after fixing above, thanks.
>
I have tested my patch, i got following errors.
make[2]: Entering directory `/home/jiawei/workshop1/sheepdog/lib'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/home/jiawei/workshop1/sheepdog/lib'
make[1]: Leaving directory `/home/jiawei/workshop1/sheepdog/lib'
Making install in collie
make[1]: Entering directory `/home/jiawei/workshop1/sheepdog/collie'
CC collie.o
collie.c: In function ‘crash_handler’:
collie.c:318:15: error: ‘SIGABRT’ undeclared (first use in this function)
collie.c:318:15: note: each undeclared identifier is reported only
once for each function it appears in
collie.c: In function ‘main’:
collie.c:335:19: error: storage size of ‘sa_old’ isn’t known
collie.c:336:19: error: storage size of ‘sa_new’ isn’t known
collie.c:342:2: warning: implicit declaration of function
‘sigemptyset’ [-Wimplicit-function-declaration]
collie.c:344:2: warning: implicit declaration of function ‘sigaction’
[-Wimplicit-function-declaration]
collie.c:344:12: error: ‘SIGABRT’ undeclared (first use in this function)
collie.c:336:19: warning: unused variable ‘sa_new’ [-Wunused-variable]
collie.c:335:19: warning: unused variable ‘sa_old’ [-Wunused-variable]
make[1]: *** [collie.o] Error 1
make[1]: Leaving directory `/home/jiawei/workshop1/sheepdog/collie'
make: *** [install-recursive] Error 1
It seems that it has no SIGABRT variable. What about 'SIGSEGV'?
Could anyone give me some suggestions? i will give a new patch
to fix these errors.
--
Thanks
Harry Wei
More information about the sheepdog
mailing list