]> git.saurik.com Git - redis.git/commitdiff
Fix up rdbWriteRaw to return number of bytes written
authorPieter Noordhuis <pcnoordhuis@gmail.com>
Sat, 14 May 2011 10:47:42 +0000 (12:47 +0200)
committerPieter Noordhuis <pcnoordhuis@gmail.com>
Sat, 14 May 2011 10:47:42 +0000 (12:47 +0200)
src/rdb.c

index d9c819406191dfbf6d57dde5fa4174e6b3db146f..6d99375bc4c2a770241b65a1dfc1fc26ef932063 100644 (file)
--- a/src/rdb.c
+++ b/src/rdb.c
@@ -9,9 +9,9 @@
 #include "lzf.h" /* LZF compression library */
 
 static int rdbWriteRaw(rio *rdb, void *p, size_t len) {
-    if (rioWrite(rdb,p,len) == 0)
+    if (rdb && rioWrite(rdb,p,len) == 0)
         return -1;
-    return 1;
+    return len;
 }
 
 int rdbSaveType(rio *rdb, unsigned char type) {