提交 dde65f3f 编写于 作者: A antirez

added config.h for #ifdef business isolation, added fstat64 for Mac OS X

上级 ec93bba3
BEFORE REDIS 1.0.0-rc1
* Add number of keys for every DB in INFO
* maxmemory support
* Resize the expires and Sets hash tables if needed as well? For Sets the right moment to check for this is probably in SREM
* What happens if the saving child gets killed or segfaults instead of ending normally? Handle this.
* check 'server.dirty' everywere. Make it proprotional to the number of objects modified.
* Shutdown must kill other background savings before to start saving. Otherwise the DB can get replaced by the child that rename(2) after the parent for some reason. Child should trap the signal and remove the temp file name.
* Objects sharing configuration, add the directive `objectsharingpool <size>`
* Make sure to convert all the fstat() calls to 64bit versions.
* Cover most of the source code with test-redis.tcl
......
#ifndef __CONFIG_H
#define __CONFIG_H
/* malloc_size() */
#ifdef __APPLE__
#include <malloc/malloc.h>
#define HAVE_MALLOC_SIZE
#define redis_malloc_size(p) malloc_size(p)
#endif
/* define redis_fstat to fstat or fstat64() */
#ifdef __APPLE__
#define redis_fstat fstat64
#define redis_stat stat64
#else
#define redis_fstat fstat
#define redis_stat stat
#endif
#endif
......@@ -60,6 +60,8 @@
#include "lzf.h" /* LZF compression library */
#include "pqsort.h" /* Partial qsort for SORT+LIMIT */
#include "config.h"
/* Error codes */
#define REDIS_OK 0
#define REDIS_ERR -1
......@@ -3866,7 +3868,7 @@ static void updateSalvesWaitingBgsave(int bgsaveerr) {
startbgsave = 1;
slave->replstate = REDIS_REPL_WAIT_BGSAVE_END;
} else if (slave->replstate == REDIS_REPL_WAIT_BGSAVE_END) {
struct stat buf;
struct redis_stat buf;
if (bgsaveerr != REDIS_OK) {
freeClient(slave);
......@@ -3874,7 +3876,7 @@ static void updateSalvesWaitingBgsave(int bgsaveerr) {
continue;
}
if ((slave->repldbfd = open(server.dbfilename,O_RDONLY)) == -1 ||
fstat(slave->repldbfd,&buf) == -1) {
redis_fstat(slave->repldbfd,&buf) == -1) {
freeClient(slave);
redisLog(REDIS_WARNING,"SYNC failed. Can't open/stat DB after BGSAVE: %s", strerror(errno));
continue;
......
......@@ -30,12 +30,7 @@
#include <stdlib.h>
#include <string.h>
#ifdef __APPLE__
#include <malloc/malloc.h>
#define HAVE_MALLOC_SIZE
#define redis_malloc_size(p) malloc_size(p)
#endif
#include "config.h"
static size_t used_memory = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册