mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8339769: Incorrect error message during startup if working directory does not exist
Reviewed-by: naoto, dholmes, alanb
This commit is contained in:
parent
1640bd2676
commit
65b9abaa29
1 changed files with 7 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -521,12 +521,15 @@ GetJavaProperties(JNIEnv *env)
|
||||||
{
|
{
|
||||||
char buf[MAXPATHLEN];
|
char buf[MAXPATHLEN];
|
||||||
errno = 0;
|
errno = 0;
|
||||||
if (getcwd(buf, sizeof(buf)) == NULL)
|
if (getcwd(buf, sizeof(buf)) == NULL) {
|
||||||
JNU_ThrowByName(env, "java/lang/Error",
|
JNU_ThrowByName(env, "java/lang/Error",
|
||||||
"Properties init: Could not determine current working directory.");
|
"Properties init: Could not determine current working directory.");
|
||||||
else
|
return NULL;
|
||||||
|
}
|
||||||
|
else {
|
||||||
sprops.user_dir = strdup(buf);
|
sprops.user_dir = strdup(buf);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sprops.file_separator = "/";
|
sprops.file_separator = "/";
|
||||||
sprops.path_separator = ":";
|
sprops.path_separator = ":";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue