This is the mail archive of the
mailing list for the Java project.
Re: libjava configuration problems
- To: Richard Earnshaw <rearnsha at arm dot com>
- Subject: Re: libjava configuration problems
- From: Warren Levy <warrenl at redhat dot com>
- Date: Thu, 25 Jan 2001 18:54:33 -0800 (PST)
- cc: Tom Tromey <tromey at redhat dot com>, gcc-bugs at gcc dot gnu dot org, java-discuss at sources dot redhat dot com
On 24 Jan 2001, Tom Tromey wrote:
> >>>>> "Richard" == Richard Earnshaw <email@example.com> writes:
> Richard> Actually, this is wrong, the test did fail. So why does
> Richard> natSystem.cc still try to use 'timezone'?
> It didn't used to. However, Warren's rewrite the timezone code seems
> to have changed this.
> Warren, can you look into this? I don't recall what the old code did
> (but I'm sure cvs does :-), but it is definitely important to use the
> results of configure.
Actually, nothing changed; it has been this way (even when the code was in
java/util/natTimeZone.cc). I wrote that code when I converted the
corresponding JNI code in Classpath to a CNI routine. Classpath doesn't
seem to check for this issue.
Richard, I think the attached patch will do the trick. It builds and
doesn't cause any regressions on my x86 linux box. Please see if it takes
care of the problem on yours.
If it does (and since it fixes a build/portability issue), I assume it
would be a good patch to commit even while the tree is "slushy". As I am
new to the GCC project rules (since libgcj is a relatively new component),
if this is a bad assumption, someone please slap me on the wrist asap ;-).
RCS file: /cvs/gcc/egcs/libjava/java/lang/natSystem.cc,v
retrieving revision 1.33
diff -u -p -r1.33 natSystem.cc
--- natSystem.cc 2001/01/12 19:16:05 1.33
+++ natSystem.cc 2001/01/26 02:25:36
@@ -240,15 +240,24 @@ getpwuid_adaptor(T_passwd * (*getpwuid_r
+ struct tm *tim;
char **tzinfo, *tzid;
current_time = time(0);
+ mktime(tim = localtime(¤t_time));
+ tzoffset = -(tim->tm_gmtoff); // tm_gmtoff is secs EAST of UTC.
+ tzoffset = timezone; // timezone is secs WEST of UTC.
+ // FIXME: there must be another global if neither tm_gmtoff nor timezone
+ // is available, esp. if tzname is valid.
+ tzoffset = 0;
tzinfo = tzname;
- tzoffset = timezone;
if ((tzoffset % 3600) == 0)
tzoffset = tzoffset / 3600;