未验证 提交 83a927dc 编写于 作者: S slguan 提交者: GitHub

Merge pull request #1534 from sangshuduo/fix-compile-warning-of-walMain-c

fix walMain.c compile warning.
......@@ -125,7 +125,7 @@ int walRenew(twal_h handle) {
if (pWal->num > pWal->max) {
// 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);
if (remove(name) <0) {
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
uint32_t maxId = 0, minId = -1, index =0;
int plen = strlen(walPrefix);
char opath[TSDB_FILENAME_LEN];
char opath[TSDB_FILENAME_LEN+5];
sprintf(opath, "%s/old", pWal->path);
// is there old directory?
......@@ -294,8 +294,8 @@ static int walRestoreWalFile(char *name, void *pVnode, int (*writeFp)(void *, SW
int walHandleExistingFiles(char *path) {
int code = 0;
char oname[TSDB_FILENAME_LEN];
char nname[TSDB_FILENAME_LEN];
char oname[TSDB_FILENAME_LEN * 3];
char nname[TSDB_FILENAME_LEN * 3];
char opath[TSDB_FILENAME_LEN];
sprintf(opath, "%s/old", path);
......@@ -336,7 +336,7 @@ int walHandleExistingFiles(char *path) {
static int walRemoveWalFiles(char *path) {
int plen = strlen(walPrefix);
char name[TSDB_FILENAME_LEN];
char name[TSDB_FILENAME_LEN * 3];
int code = 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.
先完成此消息的编辑!
想要评论请 注册