]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/fb-limfd.c
io-careful: Do not fail if a system call is interrupted by a signal
[libucw.git] / ucw / fb-limfd.c
index 76e728a495b34718c137924e36f44bacc085814d..426f57f79d1d59e4c3b3135999b44e00a9173e7a 100644 (file)
@@ -7,8 +7,8 @@
  *     of the GNU Lesser General Public License.
  */
 
-#include "ucw/lib.h"
-#include "ucw/fastbuf.h"
+#include <ucw/lib.h>
+#include <ucw/fastbuf.h>
 
 #include <unistd.h>
 
@@ -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
@@ -40,7 +40,7 @@ bfl_close(struct fastbuf *f)
 }
 
 struct fastbuf *
-bopen_limited_fd(int fd, uns buflen, uns limit)
+bopen_limited_fd(int fd, uint buflen, uint limit)
 {
   struct fb_limfd *F = xmalloc(sizeof(struct fb_limfd) + buflen);
   struct fastbuf *f = &F->fb;