This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: FYI: posix.cc fix


I'm checking this in, branch and trunk.  The build was broken without
this.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>

	* posix.cc (internal_gettimeofday): New function.
	(_Jv_select): Use it.

Index: posix.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/posix.cc,v
retrieving revision 1.4
diff -u -r1.4 posix.cc
--- posix.cc 2002/03/08 01:03:54 1.4
+++ posix.cc 2002/03/08 16:26:34
@@ -62,6 +62,18 @@
 #endif
 }
 
+static inline void
+internal_gettimeofday (struct timeval *result)
+{
+#if defined (HAVE_GETTIMEOFDAY)
+  gettimeofday (result, NULL);
+#else
+  jlong val = _Jv_platform_gettimeofday ();
+  result->tv_sec = val / 1000;
+  result->tv_usec = (val % 1000) * 1000;
+#endif /* HAVE_GETTIMEOFDAY */
+}
+
 // A wrapper for select() which ignores EINTR.
 int
 _Jv_select (int n, fd_set *readfds, fd_set  *writefds,
@@ -72,7 +84,7 @@
   struct timeval end, delay;
   if (timeout)
     {
-      _Jv_platform_gettimeofday (&end);
+      internal_gettimeofday (&end);
       end.tv_usec += timeout->tv_usec;
       if (end.tv_usec >= 1000000)
 	{
@@ -102,7 +114,7 @@
       struct timeval after;
       if (timeout)
 	{
-	  _Jv_platform_gettimeofday (&after);
+	  internal_gettimeofday (&after);
 	  // Now compute new timeout argument.
 	  delay.tv_usec = end.tv_usec - after.tv_usec;
 	  delay.tv_sec = end.tv_sec - after.tv_sec;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]