File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
src/java.base/unix/native/libjava Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 1998, 2023 , Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 1998, 2024 , Oracle and/or its affiliates. All rights reserved.
33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44 *
55 * This code is free software; you can redistribute it and/or modify it
@@ -521,11 +521,14 @@ GetJavaProperties(JNIEnv *env)
521521 {
522522 char buf [MAXPATHLEN ];
523523 errno = 0 ;
524- if (getcwd (buf , sizeof (buf )) == NULL )
524+ if (getcwd (buf , sizeof (buf )) == NULL ) {
525525 JNU_ThrowByName (env , "java/lang/Error" ,
526- "Properties init: Could not determine current working directory." );
527- else
526+ "Properties init: Could not determine current working directory." );
527+ return NULL ;
528+ }
529+ else {
528530 sprops .user_dir = strdup (buf );
531+ }
529532 }
530533
531534 sprops .file_separator = "/" ;
You can’t perform that action at this time.
0 commit comments