X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=ucw%2Ffb-limfd.c;h=e1756102b5afdf900bcfc4f203e15249402ea4ea;hb=3ddd3c4748a4022cb9c4e73215ca5280adb5ca45;hp=f909da3bb027f77f733f1835a302c319975ebeb7;hpb=681b277c0aabea785a21e109dc07338847c0cb32;p=libucw.git diff --git a/ucw/fb-limfd.c b/ucw/fb-limfd.c index f909da3b..e1756102 100644 --- a/ucw/fb-limfd.c +++ b/ucw/fb-limfd.c @@ -7,8 +7,8 @@ * of the GNU Lesser General Public License. */ -#include "ucw/lib.h" -#include "ucw/fastbuf.h" +#include +#include #include @@ -17,7 +17,7 @@ struct fb_limfd { int fd; /* File descriptor */ int limit; }; -#define FB_LIMFD(f) ((struct fb_limfd *)(f)->is_fastbuf) +#define FB_LIMFD(f) ((struct fb_limfd *)(f)) #define FB_BUFFER(f) (byte *)(FB_LIMFD(f) + 1) static int @@ -27,7 +27,7 @@ bfl_refill(struct fastbuf *f) int max = MIN(FB_LIMFD(f)->limit - f->pos, f->bufend - f->buffer); int l = read(FB_LIMFD(f)->fd, f->buffer, max); if (l < 0) - bthrow(f, "fb.read", "Error reading %s: %m", f->name); + bthrow(f, "read", "Error reading %s: %m", f->name); f->bstop = f->buffer + l; f->pos += l; return l; @@ -55,7 +55,6 @@ bopen_limited_fd(int fd, uns buflen, uns limit) f->refill = bfl_refill; f->close = bfl_close; f->can_overwrite_buffer = 2; - fb_tie(f); return f; }