Skip to content

Commit

Permalink
8265047: Inconsistent warning message in jcmd VM.log
Browse files Browse the repository at this point in the history
Reviewed-by: dholmes, stuefe, sspitsyn
  • Loading branch information
jyukutyo authored and tstuefe committed May 6, 2021
1 parent ea30bd6 commit 51f5adf
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/hotspot/share/logging/logConfiguration.cpp
Expand Up @@ -427,6 +427,7 @@ bool LogConfiguration::parse_log_arguments(const char* outputstr,

ConfigurationLock cl;
size_t idx;
bool added = false;
if (outputstr[0] == '#') { // Output specified using index
int ret = sscanf(outputstr + 1, SIZE_FORMAT, &idx);
if (ret != 1 || idx >= _n_outputs) {
Expand All @@ -447,16 +448,18 @@ bool LogConfiguration::parse_log_arguments(const char* outputstr,
LogOutput* output = new_output(normalized, output_options, errstream);
if (output != NULL) {
idx = add_output(output);
added = true;
}
} else if (output_options != NULL && strlen(output_options) > 0) {
errstream->print_cr("Output options for existing outputs are ignored.");
}

FREE_C_HEAP_ARRAY(char, normalized);
if (idx == SIZE_MAX) {
return false;
}
}
if (!added && output_options != NULL && strlen(output_options) > 0) {
errstream->print_cr("Output options for existing outputs are ignored.");
}
configure_output(idx, selections, decorators);
notify_update_listeners();
selections.verify_selections(errstream);
Expand Down

1 comment on commit 51f5adf

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.