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
This commit is contained in:
Tom Tromey 1999-12-15 22:38:56 +00:00 committed by Tom Tromey
parent 5a626f11f4
commit 6150df627a
6 changed files with 926 additions and 555 deletions

View file

@ -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'.