mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-25 05:45:11 +02:00
8062370: Various minor code improvements
A lot of fixes useful to improve the code quality. Reviewed-by: coleenp, dholmes
This commit is contained in:
parent
f048251de8
commit
0aa09022fa
35 changed files with 141 additions and 64 deletions
|
@ -384,7 +384,10 @@ void os::init_system_properties_values() {
|
|||
|
||||
// Found the full path to libjvm.so.
|
||||
// Now cut the path to <java_home>/jre if we can.
|
||||
*(strrchr(buf, '/')) = '\0'; // Get rid of /libjvm.so.
|
||||
pslash = strrchr(buf, '/');
|
||||
if (pslash != NULL) {
|
||||
*pslash = '\0'; // Get rid of /libjvm.so.
|
||||
}
|
||||
pslash = strrchr(buf, '/');
|
||||
if (pslash != NULL) {
|
||||
*pslash = '\0'; // Get rid of /{client|server|hotspot}.
|
||||
|
@ -1223,7 +1226,7 @@ void os::Linux::capture_initial_stack(size_t max_size) {
|
|||
i = 0;
|
||||
if (s) {
|
||||
// Skip blank chars
|
||||
do s++; while (isspace(*s));
|
||||
do { s++; } while (s && isspace(*s));
|
||||
|
||||
#define _UFM UINTX_FORMAT
|
||||
#define _DFM INTX_FORMAT
|
||||
|
@ -2372,6 +2375,9 @@ void os::jvm_path(char *buf, jint buflen) {
|
|||
|
||||
// Check the current module name "libjvm.so".
|
||||
p = strrchr(buf, '/');
|
||||
if (p == NULL) {
|
||||
return;
|
||||
}
|
||||
assert(strstr(p, "/libjvm") == p, "invalid library name");
|
||||
|
||||
rp = realpath(java_home_var, buf);
|
||||
|
@ -2405,6 +2411,7 @@ void os::jvm_path(char *buf, jint buflen) {
|
|||
}
|
||||
|
||||
strncpy(saved_jvm_path, buf, MAXPATHLEN);
|
||||
saved_jvm_path[MAXPATHLEN - 1] = '\0';
|
||||
}
|
||||
|
||||
void os::print_jni_name_prefix_on(outputStream* st, int args_size) {
|
||||
|
@ -5354,7 +5361,7 @@ static jlong slow_thread_cpu_time(Thread *thread, bool user_sys_cpu_time) {
|
|||
if (s == NULL) return -1;
|
||||
|
||||
// Skip blank chars
|
||||
do s++; while (isspace(*s));
|
||||
do { s++; } while (s && isspace(*s));
|
||||
|
||||
count = sscanf(s,"%c %d %d %d %d %d %lu %lu %lu %lu %lu %lu %lu",
|
||||
&cdummy, &idummy, &idummy, &idummy, &idummy, &idummy,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue