On 2016/04/29 at 17:29, Pratyush Anand wrote:
Hi Xunlei,
On Fri, Apr 29, 2016 at 2:15 PM, Xunlei Pang <xpang(a)redhat.com> wrote:
> Besides, I would recommend "return 0" for successful cases,
> and "return 1" for failed cases, it's semantically better.
I think all the function which starts with is_ has same semantic what
has been used in this patch. For example, when
is_dump_target_configured() returns 1, it means dump target has been
used in kdump.conf. Moreover, it seems reasonable to return true(1)
when answer of question is_xxxxxxx is "yes".
Yes, I understood that way at the beginning, but in shell world, seems
return 0 is true.
is_dump_target_configured() actually returns 0 for true cases(target found):
[ -n "$_target" ]
if $_target is NULL, $? is 1, otherwise $? is 0(true).
Please correct me if I'm wrong :-)
Regards,
Xunlei
> Then we can have:
>
> if ! is_crash_mem_reserved; then
> return 1
> fi
~Pratyush