[sheepdog] [PATCH] collie: cleanup callbacks of collie command when they send header only requests

Yunkai Zhang yunkai.me at gmail.com
Fri Jul 27 08:02:05 CEST 2012


On Fri, Jul 27, 2012 at 1:44 PM, Liu Yuan <namei.unix at gmail.com> wrote:
> On 07/27/2012 12:37 PM, Yunkai Zhang wrote:
>> I just want to keep the new code consistent with the original version.
>>
>
> The old code is broken -- not consistent in all places, that didn't
> abbey the same rule for error code.
>
>> The upper code, such as cluster_shutdown, will return different EXIT
>> code(EXIT_SYSFAIL or EXIT_FAILURE) to user according different error
>> type.
>>
>> Does user care about this EXIT code? If not, I'm not against to change
>> send_light_req().
>
> If you want to return EXIT_XXX to user space, then I'd suggest:
>   return EXIT_SUCCESS for success and return EXIT_XXX for other error
> case instead of -1 and 1 for error case, then upper code doesn't need to

In fact, my fist inner version return EXIT_XXX in send_light_req(),
but I found that EXIT_xxx code defined in exits.h, they seems not
appropriate for library functions (compare to exe_req()/send_req() and
other system calls).Library functions usually return errno instead of
EXIT code.

> translate these error code.
>
> Thanks,
> Yuan



-- 
Yunkai Zhang
Work at Taobao



More information about the sheepdog mailing list