Skip to content
This repository

Fix warning in redis.c for sentinel config load #603

Merged
merged 1 commit into from over 1 year ago

2 participants

Michael Bernstein Salvatore Sanfilippo
Michael Bernstein
mrb commented July 24, 2012

Currently if you load redis-sentinel without a config file, it tells you to use redis-server instead. This fixes the warning.

Took a suggestion from @pietern to use argv[0] - this was initially to avoid checking redis.sentinel_mode, but I like this compromise because it provides both the exact string used to start the binary + the right name of the conf file.

Michael Bernstein
mrb commented July 25, 2012

@antirez Updated with your suggestion

Salvatore Sanfilippo antirez merged commit 42c5718 into from July 25, 2012
Salvatore Sanfilippo antirez closed this July 25, 2012
Salvatore Sanfilippo
Owner

Thank you, merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Jul 25, 2012
Michael Bernstein Fix warning in redis.c for sentinel config load f1c8661
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. 2  src/redis.c
2  src/redis.c
@@ -2596,7 +2596,7 @@ int main(int argc, char **argv) {
2596 2596
         loadServerConfig(configfile,options);
2597 2597
         sdsfree(options);
2598 2598
     } else {
2599  
-        redisLog(REDIS_WARNING,"Warning: no config file specified, using the default config. In order to specify a config file use 'redis-server /path/to/redis.conf'");
  2599
+        redisLog(REDIS_WARNING, "Warning: no config file specified, using the default config. In order to specify a config file use %s /path/to/%s.conf", argv[0], server.sentinel_mode ? "sentinel" : "redis");
2600 2600
     }
2601 2601
     if (server.daemonize) daemonize();
2602 2602
     initServer();
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.