mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-23 04:10:26 +08:00
natSystemProperties.cc: Add additional check for getpwuid_r on _POSIX_PTHREAD_SEMANTICS.
2006-08-01 Andreas Tobler <a.tobler@schweiz.ch> * gnu/classpath/natSystemProperties.cc: Add additional check for getpwuid_r on _POSIX_PTHREAD_SEMANTICS. (SystemProperties::insertSystemProperties): Likewise. * java/io/natFilePosix.cc (File::performList): Add additional check for readdir_r on _POSIX_PTHREAD_SEMANTICS. * java/util/natVMTimeZone.cc (VMTimeZone::getSystemTimeZoneId): Add additional check for localtime_r on _POSIX_PTHREAD_SEMANTICS. From-SVN: r115864
This commit is contained in:
parent
9beafc83ca
commit
d2b815074b
@ -1,3 +1,13 @@
|
||||
2006-08-01 Andreas Tobler <a.tobler@schweiz.ch>
|
||||
|
||||
* gnu/classpath/natSystemProperties.cc: Add additional check for
|
||||
getpwuid_r on _POSIX_PTHREAD_SEMANTICS.
|
||||
(SystemProperties::insertSystemProperties): Likewise.
|
||||
* java/io/natFilePosix.cc (File::performList): Add
|
||||
additional check for readdir_r on _POSIX_PTHREAD_SEMANTICS.
|
||||
* java/util/natVMTimeZone.cc (VMTimeZone::getSystemTimeZoneId): Add
|
||||
additional check for localtime_r on _POSIX_PTHREAD_SEMANTICS.
|
||||
|
||||
2006-07-31 Thomas Fitzsimmons <fitzsim@redhat.com>
|
||||
|
||||
PR libgcj/28312
|
||||
|
@ -82,7 +82,7 @@ file_encoding ()
|
||||
|
||||
static const char *default_file_encoding = DEFAULT_FILE_ENCODING;
|
||||
|
||||
#if HAVE_GETPWUID_R
|
||||
#if defined(HAVE_GETPWUID_R) && defined(_POSIX_PTHREAD_SEMANTICS)
|
||||
/* Use overload resolution to find out the signature of getpwuid_r. */
|
||||
|
||||
/* This is Posix getpwuid_r. */
|
||||
@ -223,7 +223,7 @@ gnu::classpath::SystemProperties::insertSystemProperties (java::util::Properties
|
||||
uid_t user_id = getuid ();
|
||||
struct passwd *pwd_entry;
|
||||
|
||||
#ifdef HAVE_GETPWUID_R
|
||||
#if defined(HAVE_GETPWUID_R) && defined(_POSIX_PTHREAD_SEMANTICS)
|
||||
struct passwd pwd_r;
|
||||
size_t len_r = 200;
|
||||
char *buf_r = (char *) _Jv_AllocBytes (len_r);
|
||||
|
@ -1,6 +1,7 @@
|
||||
// natFile.cc - Native part of File class for POSIX.
|
||||
|
||||
/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation
|
||||
/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2006
|
||||
Free Software Foundation
|
||||
|
||||
This file is part of libgcj.
|
||||
|
||||
@ -288,7 +289,7 @@ java::io::File::performList (java::io::FilenameFilter *filter,
|
||||
|
||||
java::util::ArrayList *list = new java::util::ArrayList ();
|
||||
struct dirent *d;
|
||||
#ifdef HAVE_READDIR_R
|
||||
#if defined(HAVE_READDIR_R) && defined(_POSIX_PTHREAD_SEMANTICS)
|
||||
int name_max = pathconf (buf, _PC_NAME_MAX);
|
||||
char dbuf[sizeof (struct dirent) + name_max + 1];
|
||||
while (readdir_r (dir, (struct dirent *) dbuf, &d) == 0 && d != NULL)
|
||||
|
@ -1,6 +1,6 @@
|
||||
// natVMTimeZone.cc -- Native side of VMTimeZone class.
|
||||
|
||||
/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004
|
||||
/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006
|
||||
Free Software Foundation
|
||||
|
||||
This file is part of libgcj.
|
||||
@ -54,7 +54,7 @@ jstring
|
||||
java::util::VMTimeZone::getSystemTimeZoneId()
|
||||
{
|
||||
struct tm tim;
|
||||
#ifndef HAVE_LOCALTIME_R
|
||||
#if !defined(HAVE_LOCALTIME_R) || !defined(_POSIX_PTHREAD_SEMANTICS)
|
||||
struct tm *lt_tim;
|
||||
#endif
|
||||
#ifdef HAVE_TM_ZONE
|
||||
@ -66,7 +66,7 @@ java::util::VMTimeZone::getSystemTimeZoneId()
|
||||
char *tzid;
|
||||
|
||||
time(¤t_time);
|
||||
#ifdef HAVE_LOCALTIME_R
|
||||
#if defined(HAVE_LOCALTIME_R) && defined(_POSIX_PTHREAD_SEMANTICS)
|
||||
localtime_r(¤t_time, &tim);
|
||||
#else
|
||||
/* Fall back on non-thread safe localtime. */
|
||||
|
Loading…
x
Reference in New Issue
Block a user