make sure to flush stdout every line read in monitor mode, to play well with redirection to file

This commit is contained in:
antirez 2010-11-08 16:14:15 +01:00
parent c9d5275fe0
commit e2759a75b5

View File

@ -291,6 +291,7 @@ static int cliSendCommand(int argc, char **argv, int repeat) {
redisAppendCommandArgv(context,argc,(const char**)argv,argvlen); redisAppendCommandArgv(context,argc,(const char**)argv,argvlen);
while (config.monitor_mode) { while (config.monitor_mode) {
if (cliReadReply() != REDIS_OK) exit(1); if (cliReadReply() != REDIS_OK) exit(1);
fflush(stdout);
} }
if (config.pubsub_mode) { if (config.pubsub_mode) {