[PATCH 1/7] bb_ioctl implementation - improved

Tito farmatito at tiscali.it
Wed Jul 11 09:38:15 PDT 2007


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.

Ciao,
Tito
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bb_ioctl_core_02.patch
Type: text/x-diff
Size: 3519 bytes
Desc: not available
Url : http://busybox.net/lists/busybox/attachments/20070711/7bea75b7/attachment-0001.bin 


More information about the busybox mailing list