< prev index next >
src/share/vm/logging/logFileOutput.cpp
Print this page
*** 24,33 ****
--- 24,34 ----
#include "precompiled.hpp"
#include "logging/log.hpp"
#include "logging/logConfiguration.hpp"
#include "logging/logFileOutput.hpp"
#include "memory/allocation.inline.hpp"
+ #include "runtime/arguments.hpp"
#include "runtime/os.inline.hpp"
#include "utilities/globalDefinitions.hpp"
#include "utilities/defaultStream.hpp"
const char* LogFileOutput::FileOpenMode = "a";
*** 185,202 ****
success = false;
break;
}
_file_count = static_cast<uint>(value);
} else if (strcmp(FileSizeOptionKey, key) == 0) {
! size_t value = parse_value(value_str);
! if (value == SIZE_MAX || value > SIZE_MAX / K) {
errstream->print_cr("Invalid option: %s must be in range [0, "
! SIZE_FORMAT "]", FileSizeOptionKey, SIZE_MAX / K);
success = false;
break;
}
! _rotate_size = value * K;
} else {
errstream->print_cr("Invalid option '%s' for log file output.", key);
success = false;
break;
}
--- 186,204 ----
success = false;
break;
}
_file_count = static_cast<uint>(value);
} else if (strcmp(FileSizeOptionKey, key) == 0) {
! julong value;
! success = Arguments::atojulong(value_str, &value);
! if (!success || (value > SIZE_MAX)) {
errstream->print_cr("Invalid option: %s must be in range [0, "
! SIZE_FORMAT "]", FileSizeOptionKey, SIZE_MAX);
success = false;
break;
}
! _rotate_size = static_cast<size_t>(value);
} else {
errstream->print_cr("Invalid option '%s' for log file output.", key);
success = false;
break;
}
< prev index next >