提交 2da4cd5a 编写于 作者: sangshuduo's avatar sangshuduo

fix walMain.c compile warning.

上级 f8908155
...@@ -125,7 +125,7 @@ int walRenew(twal_h handle) { ...@@ -125,7 +125,7 @@ int walRenew(twal_h handle) {
if (pWal->num > pWal->max) { if (pWal->num > pWal->max) {
// remove the oldest wal file // remove the oldest wal file
char name[TSDB_FILENAME_LEN]; char name[TSDB_FILENAME_LEN * 3];
sprintf(name, "%s/%s%d", pWal->path, walPrefix, pWal->id - pWal->max); sprintf(name, "%s/%s%d", pWal->path, walPrefix, pWal->id - pWal->max);
if (remove(name) <0) { if (remove(name) <0) {
wError("wal:%s, failed to remove(%s)", name, strerror(errno)); wError("wal:%s, failed to remove(%s)", name, strerror(errno));
...@@ -177,7 +177,7 @@ int walRestore(void *handle, void *pVnode, int (*writeFp)(void *, SWalHead *, in ...@@ -177,7 +177,7 @@ int walRestore(void *handle, void *pVnode, int (*writeFp)(void *, SWalHead *, in
uint32_t maxId = 0, minId = -1, index =0; uint32_t maxId = 0, minId = -1, index =0;
int plen = strlen(walPrefix); int plen = strlen(walPrefix);
char opath[TSDB_FILENAME_LEN]; char opath[TSDB_FILENAME_LEN+5];
sprintf(opath, "%s/old", pWal->path); sprintf(opath, "%s/old", pWal->path);
// is there old directory? // is there old directory?
...@@ -294,8 +294,8 @@ static int walRestoreWalFile(char *name, void *pVnode, int (*writeFp)(void *, SW ...@@ -294,8 +294,8 @@ static int walRestoreWalFile(char *name, void *pVnode, int (*writeFp)(void *, SW
int walHandleExistingFiles(char *path) { int walHandleExistingFiles(char *path) {
int code = 0; int code = 0;
char oname[TSDB_FILENAME_LEN]; char oname[TSDB_FILENAME_LEN * 3];
char nname[TSDB_FILENAME_LEN]; char nname[TSDB_FILENAME_LEN * 3];
char opath[TSDB_FILENAME_LEN]; char opath[TSDB_FILENAME_LEN];
sprintf(opath, "%s/old", path); sprintf(opath, "%s/old", path);
...@@ -336,7 +336,7 @@ int walHandleExistingFiles(char *path) { ...@@ -336,7 +336,7 @@ int walHandleExistingFiles(char *path) {
static int walRemoveWalFiles(char *path) { static int walRemoveWalFiles(char *path) {
int plen = strlen(walPrefix); int plen = strlen(walPrefix);
char name[TSDB_FILENAME_LEN]; char name[TSDB_FILENAME_LEN * 3];
int code = 0; int code = 0;
if (access(path, F_OK) != 0) return 0; if (access(path, F_OK) != 0) return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册