summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2017-12-11 11:21:48 +0100
committerantirez <antirez@gmail.com>2017-12-11 11:21:48 +0100
commit2edd855651555081620ff45f30130148c93cb8e9 (patch)
treec658fd0745f724b321645ec168bb3c2e1c316b0b
parentc01b804d3f614caabaa4853beae1cb7f56e764f0 (diff)
downloadredis-2edd855651555081620ff45f30130148c93cb8e9.tar.gz
Improve startLoadingFile() top comment.
-rw-r--r--src/rdb.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/rdb.c b/src/rdb.c
index 780b6cc8c..212dc86d8 100644
--- a/src/rdb.c
+++ b/src/rdb.c
@@ -1560,9 +1560,11 @@ void startLoading(size_t size) {
server.loading_total_bytes = size;
}
-/* Mark that we are loading in the global state and setup the fields
- * needed to provide loading stats.
- * 'filename' is optional and used for rdb-check on error */
+/* This is a wrapper for startLoading() that takes a file pointer instead of
+ * the size of the file, and does the work of calling fstat() to get the size.
+ * Moreover, if the optional 'filename' is passed, the global
+ * 'rdbFileBeingLoaded' is set, and will cause an RDB check on that file in
+ * case the loading of the file fails becuase of encoding errors. */
void startLoadingFile(FILE *fp, char* filename) {
struct stat sb;
if (fstat(fileno(fp), &sb) == -1)