Files
i2p.itoopie/installer/lib/wrapper/macosx/wrapper_unix.c.diff

61 lines
1.5 KiB
Diff
Raw Normal View History

--- wrapper_3.1.1_src/src/c/wrapper_unix.c Fri Jul 16 10:29:10 2004
+++ wrapper_3.1.1_src_modified/src/c/wrapper_unix.c Fri Sep 16 14:45:48 2005
@@ -309,7 +309,13 @@
#include <limits.h>
#include <pthread.h>
#include <pwd.h>
+
+#ifdef MACOSX
+#include <sys/time.h>
+#else
#include <sys/timeb.h>
+#endif
+
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
@@ -1056,7 +1062,11 @@
ssize_t bytesRead;
char readBuf [1025];
int readBufPos, childOutputBufferPos;
+#ifdef MACOSX
+ struct timeval timeBuffer;
+#else
struct timeb timeBuffer;
+#endif
long startTime;
int startTimeMillis;
long now;
@@ -1064,9 +1074,15 @@
long durr;
if (jvmOut != -1) {
+#ifdef MACOSX
+ gettimeofday(&timeBuffer, NULL);
+ startTime = now = timeBuffer.tv_sec;
+ startTimeMillis = nowMillis = timeBuffer.tv_usec / 1000;
+#else
ftime( &timeBuffer );
startTime = now = timeBuffer.time;
startTimeMillis = nowMillis = timeBuffer.millitm;
+#endif
/*
log_printf(WRAPPER_SOURCE_WRAPPER, LEVEL_DEBUG, "now=%ld, nowMillis=%d", now, nowMillis);
@@ -1159,9 +1175,15 @@
}
/* Get the time again */
+#ifdef MACOSX
+ gettimeofday(&timeBuffer, NULL);
+ now = timeBuffer.tv_sec;
+ nowMillis = timeBuffer.tv_usec / 1000;
+#else
ftime( &timeBuffer );
now = timeBuffer.time;
nowMillis = timeBuffer.millitm;
+#endif
}
}