| 1068 | } |
| 1069 | |
| 1070 | void shutdownCommand(client *c) { |
| 1071 | int flags = 0; |
| 1072 | |
| 1073 | if (c->argc > 2) { |
| 1074 | addReplyErrorObject(c,shared.syntaxerr); |
| 1075 | return; |
| 1076 | } else if (c->argc == 2) { |
| 1077 | if (!strcasecmp(c->argv[1]->ptr,"nosave")) { |
| 1078 | flags |= SHUTDOWN_NOSAVE; |
| 1079 | } else if (!strcasecmp(c->argv[1]->ptr,"save")) { |
| 1080 | flags |= SHUTDOWN_SAVE; |
| 1081 | } else { |
| 1082 | addReplyErrorObject(c,shared.syntaxerr); |
| 1083 | return; |
| 1084 | } |
| 1085 | } |
| 1086 | if (prepareForShutdown(flags) == C_OK) exit(0); |
| 1087 | addReplyError(c,"Errors trying to SHUTDOWN. Check logs."); |
| 1088 | } |
| 1089 | |
| 1090 | void renameGenericCommand(client *c, int nx) { |
| 1091 | robj *o; |
nothing calls this directly
no test coverage detected