mirror of
https://github.com/corda/corda.git
synced 2025-01-06 05:04:20 +00:00
use getcwd instead of getenv("PWD") to get working directory
PWD is not always set, whereas getcwd is more reliable.
This commit is contained in:
parent
e5ecb5b549
commit
a3a7a7a2de
@ -59,6 +59,7 @@ typedef int socklen_t;
|
||||
#else // not PLATFORM_WINDOWS
|
||||
|
||||
# include <unistd.h>
|
||||
# include <limits.h>
|
||||
# include <sys/types.h>
|
||||
# include <sys/stat.h>
|
||||
# include <sys/socket.h>
|
||||
@ -2586,7 +2587,10 @@ jvmInitProperties(Thread* t, uintptr_t* arguments)
|
||||
# endif
|
||||
local::setProperty(t, method, *properties, "java.io.tmpdir", "/tmp");
|
||||
local::setProperty(t, method, *properties, "user.home", getenv("HOME"));
|
||||
local::setProperty(t, method, *properties, "user.dir", getenv("PWD"));
|
||||
|
||||
char buffer[PATH_MAX];
|
||||
local::setProperty(t, method, *properties, "user.dir",
|
||||
getcwd(buffer, PATH_MAX));
|
||||
#endif
|
||||
|
||||
local::setProperty(t, method, *properties, "java.protocol.handler.pkgs",
|
||||
|
Loading…
Reference in New Issue
Block a user