]> mj.ucw.cz Git - libucw.git/blobdiff - lib/fb-file.c
simplified usage of Log & Die
[libucw.git] / lib / fb-file.c
index 0dcf22a958978a2d0fe0ea0ab97ca94137f27d62..a7290cbf8688f9de261a38c4e50dbb9584eee91e 100644 (file)
@@ -11,6 +11,7 @@
 #include "lib/fastbuf.h"
 #include "lib/lfs.h"
 
+#include <stdio.h>
 #include <string.h>
 #include <fcntl.h>
 #include <unistd.h>
@@ -53,16 +54,14 @@ bfd_spout(struct fastbuf *f)
   f->bptr = f->buffer = FB_BUFFER(f);
 }
 
-static void
+static int
 bfd_seek(struct fastbuf *f, sh_off_t pos, int whence)
 {
-  if (whence == SEEK_SET && pos == f->pos)
-    return;
-
   sh_off_t l = sh_seek(FB_FILE(f)->fd, pos, whence);
   if (l < 0)
-    die("lseek on %s: %m", f->name);
+    return 0;
   f->pos = l;
+  return 1;
 }
 
 static void