]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/fastbuf.c
Resources: Allow res_free(NULL) and res_detach(NULL)
[libucw.git] / ucw / fastbuf.c
index 4cd8bdfd1ccb467cce5bd37d61f75b1d47aa61d5..4068aab89adef2e30868530da34ea70686d5e1b5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *     UCW Library -- Fast Buffered I/O
  *
- *     (c) 1997--2007 Martin Mares <mj@ucw.cz>
+ *     (c) 1997--2011 Martin Mares <mj@ucw.cz>
  *
  *     This software may be freely distributed and used according to the terms
  *     of the GNU Lesser General Public License.
@@ -301,10 +301,10 @@ static void fb_res_free(struct resource *r)
   bclose(f);
 }
 
-static void fb_res_dump(struct resource *r)
+static void fb_res_dump(struct resource *r, uns indent UNUSED)
 {
   struct fastbuf *f = r->priv;
-  printf(" name=%s", f->name);
+  printf(" name=%s\n", f->name);
 }
 
 static const struct res_class fb_res_class = {
@@ -314,7 +314,8 @@ static const struct res_class fb_res_class = {
   .free = fb_res_free,
 };
 
-void fb_tie(struct fastbuf *f)
+struct fastbuf *fb_tie(struct fastbuf *f)
 {
   f->res = res_new(&fb_res_class, f);
+  return f;
 }