diff options
author | Binbin <binloveplay1314@qq.com> | 2022-05-29 18:33:16 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-29 13:33:16 +0300 |
commit | f18c9da3e196e337fdc0b8bcddad2d1cdfe8ed02 (patch) | |
tree | f1652fff974a796e554c0072889ee3b276a6f122 /src/aof.c | |
parent | 2f5edd03e6d25f400a6eade67d08c329adc8ef12 (diff) | |
download | redis-f18c9da3e196e337fdc0b8bcddad2d1cdfe8ed02.tar.gz |
loadAppendOnlyFiles and loadSingleAppendOnlyFile ret should be AOF_OK, not C_OK (#10790)
The ret value should be AOF_OK instead of C_OK.
AOF_OK and C_OK are both 0, so this is just a cleanup.
Also updated some outdated comments.
Diffstat (limited to 'src/aof.c')
-rw-r--r-- | src/aof.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1353,7 +1353,7 @@ int loadSingleAppendOnlyFile(char *filename) { off_t valid_up_to = 0; /* Offset of latest well-formed command loaded. */ off_t valid_before_multi = 0; /* Offset before MULTI command loaded. */ off_t last_progress_report_size = 0; - int ret = C_OK; + int ret = AOF_OK; sds aof_filepath = makePath(server.aof_dirname, filename); FILE *fp = fopen(aof_filepath, "r"); @@ -1533,7 +1533,7 @@ int loadSingleAppendOnlyFile(char *filename) { goto uxeof; } -loaded_ok: /* DB loaded, cleanup and return C_OK to the caller. */ +loaded_ok: /* DB loaded, cleanup and return success (AOF_OK or AOF_TRUNCATED). */ loadingIncrProgress(ftello(fp) - last_progress_report_size); server.aof_state = old_aof_state; goto cleanup; @@ -1594,7 +1594,7 @@ cleanup: /* Load the AOF files according the aofManifest pointed by am. */ int loadAppendOnlyFiles(aofManifest *am) { serverAssert(am != NULL); - int status, ret = C_OK; + int status, ret = AOF_OK; long long start; off_t total_size = 0, base_size = 0; sds aof_name; @@ -2268,7 +2268,7 @@ int rewriteAppendOnlyFileRio(rio *aof) { } /* In fork child process, we can try to release memory back to the - * OS and possibly avoid or decrease COW. We guve the dismiss + * OS and possibly avoid or decrease COW. We give the dismiss * mechanism a hint about an estimated size of the object we stored. */ size_t dump_size = aof->processed_bytes - aof_bytes_before_key; if (server.in_fork_child) dismissObject(o, dump_size); |