Commit 6150df62 by Tom Tromey Committed by Tom Tromey

natSystem.cc (init_properties): Don't set user.name or user.home if NO_GETUID defined.

	* java/lang/natSystem.cc (init_properties): Don't set user.name or
	user.home if NO_GETUID defined.  Only set user.dir if getcwd
	exists.

	* include/config.h.in: Rebuilt.
	* acconfig.h (NO_GETUID): New define.
	* configure.in: Rebuilt.
	* configure.in: Define NO_GETUID in cross case.  Check for getcwd
	in native case.

From-SVN: r30964
parent 5a626f11
1999-12-15 Tom Tromey <tromey@cygnus.com>
* java/lang/natSystem.cc (init_properties): Don't set user.name or
user.home if NO_GETUID defined. Only set user.dir if getcwd
exists.
* include/config.h.in: Rebuilt.
* acconfig.h (NO_GETUID): New define.
* configure.in: Rebuilt.
* configure.in: Define NO_GETUID in cross case. Check for getcwd
in native case.
1999-12-08 Tom Tromey <tromey@cygnus.com>
* include/posix-threads.h (_Jv_PthreadCheckMonitor): Handle case
......
......@@ -119,3 +119,6 @@
/* Define if using setjmp/longjmp exceptions. */
#undef SJLJ_EXCEPTIONS
/* Define if getuid() and friends are missing. */
#undef NO_GETUID
......@@ -318,6 +318,9 @@ if test -n "${with_cross_host}"; then
dnl We also assume we are using gcc, which provides alloca.
AC_DEFINE(HAVE_ALLOCA)
dnl Assume we do not have getuid and friends.
AC_DEFINE(NO_GETUID)
ZLIBSPEC=-lzgcj
# If Canadian cross, then don't pick up tools from the build
......@@ -332,7 +335,7 @@ if test -n "${with_cross_host}"; then
NATIVE=no
else
AC_CHECK_FUNCS(strerror ioctl select fstat open fsync sleep)
AC_CHECK_FUNCS(gmtime_r localtime_r readdir_r getpwuid_r)
AC_CHECK_FUNCS(gmtime_r localtime_r readdir_r getpwuid_r getcwd)
AC_CHECK_FUNCS(access stat mkdir rename rmdir unlink realpath)
AC_CHECK_FUNCS(inet_aton inet_addr, break)
AC_CHECK_FUNCS(inet_pton uname inet_ntoa)
......
......@@ -135,6 +135,9 @@
/* Define if using setjmp/longjmp exceptions. */
#undef SJLJ_EXCEPTIONS
/* Define if getuid() and friends are missing. */
#undef NO_GETUID
/* Define if you have the access function. */
#undef HAVE_ACCESS
......@@ -147,6 +150,9 @@
/* Define if you have the ftime function. */
#undef HAVE_FTIME
/* Define if you have the getcwd function. */
#undef HAVE_GETCWD
/* Define if you have the gethostbyaddr_r function. */
#undef HAVE_GETHOSTBYADDR_R
......
......@@ -282,6 +282,7 @@ java::lang::System::init_properties (void)
}
#endif /* HAVE_UNAME */
#ifndef NO_GETUID
#ifdef HAVE_PWD_H
uid_t user_id = getuid ();
struct passwd *pwd_entry;
......@@ -315,7 +316,9 @@ java::lang::System::init_properties (void)
SET ("user.home", pwd_entry->pw_dir);
}
#endif /* HAVE_PWD_H */
#endif /* NO_GETUID */
#ifdef HAVE_GETCWD
#ifdef HAVE_UNISTD_H
/* Use getcwd to set "user.dir". */
int buflen = 250;
......@@ -334,7 +337,8 @@ java::lang::System::init_properties (void)
}
if (buffer != NULL)
free (buffer);
#endif
#endif /* HAVE_UNISTD_H */
#endif /* HAVE_GETCWD */
// Set some properties according to whatever was compiled in with
// `-D'.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment