From 4c0462972ecdef6fcd8155003028a41aafd70c27 Mon Sep 17 00:00:00 2001 From: antirez Date: Thu, 22 Sep 2011 15:47:48 +0200 Subject: [PATCH] comment on top of the _rio structure modified for correctness as actually fwrite/fread semantics is different in general, but was 0/1 in our old usage before rio.c as we always used 1 as number items, and the actual number of bytes to read as item length. --- src/rio.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/rio.h b/src/rio.h index fe863cb5..65442381 100644 --- a/src/rio.h +++ b/src/rio.h @@ -5,8 +5,9 @@ #include "sds.h" struct _rio { - /* Backend functions. Both read and write should return 0 for short reads - * or writes, identical to the return values of fread/fwrite. */ + /* Backend functions. + * Since this functions do not tolerate short writes or reads the return + * value is simplified to: zero on error, non zero on complete success. */ size_t (*read)(struct _rio *, void *buf, size_t len); size_t (*write)(struct _rio *, const void *buf, size_t len); off_t (*tell)(struct _rio *); -- 2.47.2