Merge pull request #1534 from sangshuduo/fix-compile-warning-of-walMain-c
fix walMain.c compile warning.
This commit is contained in:
commit
83a927dcb6
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue