Skip to content

Commit

Permalink
Downport
Browse files Browse the repository at this point in the history
  • Loading branch information
schmelter-sap committed Nov 24, 2023
1 parent ab6795b commit 3213f2f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hotspot/os/linux/vitals_linux_oswrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ class ProcFile {
return false;
}

size_t bytes_read = ::fread(_buf, 1, bufsize, f);
_buf[bufsize - 1] = '\0';
size_t bytes_read = ::fread(_buf, 1, bufsize - 1, f);
_buf[bytes_read] = '\0';

::fclose(f);

Expand Down
2 changes: 2 additions & 0 deletions src/hotspot/share/vitals/vitals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,8 @@ class SampleTables: public CHeapObj<mtInternal> {

bool should_log = (column->extremum() == MAX) && (sample->value(idx) > extremum_sample->value(idx));
should_log |= (column->extremum() == MIN) && (sample->value(idx) < extremum_sample->value(idx));
should_log &= sample->value(idx) != INVALID_VALUE;
should_log |= extremum_sample->value(idx) == INVALID_VALUE;

if (should_log) {
Sample* last_extremum_sample = _last_extremum_samples.sample_at(idx);
Expand Down

0 comments on commit 3213f2f

Please sign in to comment.