[patch iwhd 1/3] Add dc-rhev-image

Jim Meyering jim at meyering.net
Thu Mar 3 17:12:27 UTC 2011


Pete Zaitcev wrote:

> On Tue, 01 Mar 2011 16:09:05 +0100
> Jim Meyering <jim at meyering.net> wrote:
>
>> One other issue that was exposed by "syntax-check" is that
>> there are a bunch of these:
>>
>>     dc-rhev-image.c:1397:           exit(1);
>
>> +++ b/backend.c
>>  	 */
>> -	chown(bucket,-1,NFSGID);
>> +	ignore_value(chown(bucket,-1,NFSGID));
>
> Thanks, I applied this patch.

Thanks.

>>     dc-rhev-image.c:1515:           exit(2);
>>     dc-rhev-image.c:1522:           exit(1);
>>
>> It failed with this diagnostic:
>>
>>     maint.mk: use EXIT_* values rather than magic number
>>     make: *** [sc_prohibit_magic_number_exit] Error 1
>>
>> That means it's better practice to use exit(EXIT_FAILURE)
>> in place of exit(1), and, esp. exit(SOME_OTHER_SYMBOL) to
>> indicate that the exit(2) is somehow special.  I haven't
>> looked at context yet.
>
> Or, we could just exit with EXIT_FAILURE in all cases. It's not

Whichever you prefer.
I'd probably go for using EXIT_FAILURE everywhere, because
otherwise, (technically) we'd have to document the difference,
adhere to it, and even test for it.

> like anyone cares. In general 1 used to mean an execution failure,
> such as volume full, while 2 meant bad arguments. So, 1 is corrected
> by doing something outside of the program (and was retriable), while
> 2 was corrected by fixing up the code or scripts (and not retriable
> until that). We could probably assume that #2 never happens, and
> if it does, the debugging will tell what it was.
>
> -- Pete


More information about the iwhd-devel mailing list