[PATCH 1/7] bb_ioctl implementation - improved
Bernhard Fischer
rep.dot.nop at gmail.com
Wed Jul 11 22:13:48 UTC 2007
On Wed, Jul 11, 2007 at 06:38:15PM +0200, Tito wrote:
>On Wednesday 11 July 2007 13:48:52 Alex Landau wrote:
>>
>> Tito <farmatito at tiscali.it> wrote: Hi,
>> this series of 7 patches is a first attempt to add an ioctl api to libbb
>> and to use it in all applets where:
>>
>> if ( ioctl() < 0 [!= 0])
>> bb_perror_msg{and_die}();
>>
>> or similar code is used.
>> [snip]
>>
>> Critics, hints and help from the list is as always welcome.
>>
>> Ciao,
>> Tito
>>
>> Hi,
>> It looks really nice, only eye-tested though.
>> One small comment: ioctl(...) != 0 doesn't mean it's an error. the ioctl() may return a positive value,
>> so I'd better have an ioctl(...) < 0 test. Especially when you return ret afterwards.
>> Regards,
>> Alex
>>
>Hi,
>I know but i'm pretty sure that in all places in busybox where this test was used
>[ !=0 ] it errored out, i double checked it, but nonetheless maybe its a good idea
>to change it to [ < 0 ] to be more coherent with the original ioctl call.
>So attached is a fixed patch.
checking for != 0 is imho not a good idea as opposed to <0. The idea is
sound in my POV, i didn't have a chance to review it, though (vda should
be back RSN, so i hope he can take care of it).
Thanks for looking into these!
cheers,
More information about the busybox
mailing list