@cryptotaxi247 / netdata-1 / commits / 9e8a0e173

Fix shutdown via netdatacli with musl C library (#8931)

Markos Fountoulakis committed May 11, 2020 at 18:42 UTC 9e8a0e173e2f4402fb081950b4b25d5fc0b62492
1 file changed +4
daemon/commands.c
+4
@@ -449,6 +449,10 @@ static void parse_commands(struct command_context *cmd_ctx)
449 for (pos = cmd_ctx->command_string ; isspace(*pos) && ('\0' != *pos) ; ++pos) {;}
450 for (i = 0 ; i < CMD_TOTAL_COMMANDS ; ++i) {
451 if (!strncmp(pos, command_info_array[i].cmd_str, strlen(command_info_array[i].cmd_str))) {
452 + if (CMD_EXIT == i) {
453 + /* musl C does not like libuv workqueues calling exit() */
454 + execute_command(CMD_EXIT, NULL, NULL);
455 + }
456 for (lstrip=pos + strlen(command_info_array[i].cmd_str); isspace(*lstrip) && ('\0' != *lstrip); ++lstrip) {;}
457 for (rstrip=lstrip+strlen(lstrip)-1; rstrip>lstrip && isspace(*rstrip); *(rstrip--) = 0 );
458