On Tue, Feb 19, 2008 at 03:40:41AM +0300, Kirill Maslinsky wrote: > On Tue, Feb 19, 2008 at 02:23:41AM +0200, Led wrote: > > Tuesday, 19 February 2008 02:18:11 Kirill Maslinsky написав: > > [...] > > > > - if (size > PAGE_SIZE) > > > - bulk.len = PAGE_SIZE; > > > + if (size > sysconf(_SC_PAGESIZE)) > > > + bulk.len = sysconf(_SC_PAGESIZE); > > > Зачем дважды вызывать? ИМХО лучше завести переменную page_size. > > Логично. Вот так будет корректно? > > --- a/eciadsl-usermode/pusb-linux.c > +++ b/eciadsl-usermode/pusb-linux.c > @@ -29,7 +29,6 @@ > #include > > #include "pusb-linux.h" > -#include > > #include "pusb.h" > > @@ -431,6 +430,7 @@ inline int pusb_endpoint_rw(int fd, int ep, unsigned char* buf, int size, int ti > static struct usbdevfs_bulktransfer bulk; > static int ret; > int received = 0; > + int page_size = sysconf(_SC_PAGESIZE); > > do > { > @@ -438,8 +438,8 @@ inline int pusb_endpoint_rw(int fd, int ep, unsigned char* buf, int size, int ti > > bulk.len = size; > > - if (size > PAGE_SIZE) > - bulk.len = PAGE_SIZE; > + if (size > page_size) > + bulk.len = page_size; > > Вы меня простите за тупые вопросы, я просто этого языка (C) вообще не знаю, > опасаюсь напортачить. Код синтаксически корректный, но upstream может захотеть соптимизировать количество вызовов sysconf. -- ldv