Stop using /dev/null to find out the serialized object length

Now the rdbSave* functions return the number of bytes written (or
required to write) in serializing a Redis object, writing to /dev/null
and using ftell (which doesn't work on FreeBSD) isn't needed anymore.
This commit is contained in:
Pieter Noordhuis
2010-11-21 16:27:47 +01:00
parent 9a68cf91f0
commit bd70a5f588
5 changed files with 11 additions and 24 deletions

View File

@ -216,7 +216,7 @@ void debugCommand(redisClient *c) {
"encoding:%s serializedlength:%lld "
"lru:%d lru_seconds_idle:%lu",
(void*)val, val->refcount,
strenc, (long long) rdbSavedObjectLen(val,NULL),
strenc, (long long) rdbSavedObjectLen(val),
val->lru, estimateObjectIdleTime(val));
} else {
vmpointer *vp = (vmpointer*) val;