mirror of
https://github.com/fluencelabs/redis
synced 2025-06-23 14:01:34 +00:00
Handle redis-check-rdb as a standalone program.
This also makes it backward compatible in the usage, but for the command name. However the old command name was less obvious so it is worth to break it probably. With the new setup the program main can perform argument parsing and everything else useful for an RDB check regardless of the Redis server itself.
This commit is contained in:
@ -696,3 +696,15 @@ int redis_check_rdb(char *rdbfilename) {
|
||||
close(fd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* RDB check main: called form redis.c when Redis is executed with the
|
||||
* redis-check-rdb alias. */
|
||||
int redis_check_rdb_main(char **argv, int argc) {
|
||||
if (argc != 2) {
|
||||
fprintf(stderr, "Usage: %s <rdb-file-name>\n", argv[0]);
|
||||
exit(1);
|
||||
}
|
||||
redisLog(REDIS_WARNING, "Checking RDB file %s", argv[1]);
|
||||
exit(redis_check_rdb(argv[1]));
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user