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

@ -814,11 +814,6 @@ void initServer() {
setupSigSegvAction();
server.mainthread = pthread_self();
server.devnull = fopen("/dev/null","w");
if (server.devnull == NULL) {
redisLog(REDIS_WARNING, "Can't open /dev/null: %s", server.neterr);
exit(1);
}
server.clients = listCreate();
server.slaves = listCreate();
server.monitors = listCreate();