[Ocfs2-tools-devel] [PATCH 12/22] tunefs rework: Add op_set_slot_count.c

Tao Ma tao.ma at oracle.com
Fri Aug 1 02:00:43 PDT 2008



Joel Becker wrote:
> On Fri, Aug 01, 2008 at 01:34:07PM +0800, Tao Ma wrote:
>> Joel Becker wrote:
>>> 	This is intentional, because I'm using strtol(3) to parse the
>>> number.  strtol(3) provides error reporting that atoi(3) does not.  Once
>>> I have the value as a long, I then check the range of the value against
>>> negative numbers and INT_MAX, thus ensuring it's a positive int. I can
>>> then use it later as an int, which is what the slot count code wants.
>> fair enough. So could you please add some comments for this? I am not sure 
>> whether others will have the same thought as I.
> 
> 	I can, though it's a fairly common C idiom.  That's why I have
> the checks against the range following strtol(3).
Sorry for the noise and it looks that I don't know this idiom. Thanks 
for explanation. And whether adding it or not depends on you.

Regards,
Tao



More information about the Ocfs2-tools-devel mailing list