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

Joel Becker Joel.Becker at oracle.com
Fri Aug 1 01:47:18 PDT 2008


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).

Joel

-- 

"When arrows don't penetrate, see...
 Cupid grabs the pistol."

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127



More information about the Ocfs2-tools-devel mailing list