source: installer/lib/wrapper/macosx/wrapper_unix.c.diff @ d6c3ffd

Last change on this file since d6c3ffd was d6c3ffd, checked in by zzz <zzz@…>, 15 years ago

2005-09-17 jrandom

  • Added the natively compiled jbigi and patched java service wrapper for OS X. Thanks Bill Dorsey for letting me use your machine!
  • Don't build i2p.exe or i2pinstall.exe when run on OS X machines, as we don't bundle the binutils necessary (and there'd be a naming conflict if we did).
  • Added 'single user' functionality to syndie - if the single user checkbox on the admin page is checked, all users are allowed to control the instance and sync up with remote syndie nodes.
  • Temporarily disable the x-i2p-gzip in i2ptunnel until it is more closely debugged.
  • Property mode set to 100644
File size: 1.5 KB
RevLine 
[d6c3ffd]1--- wrapper_3.1.1_src/src/c/wrapper_unix.c      Fri Jul 16 10:29:10 2004
2+++ wrapper_3.1.1_src_modified/src/c/wrapper_unix.c     Fri Sep 16 14:45:48 2005
3@@ -309,7 +309,13 @@
4 #include <limits.h>
5 #include <pthread.h>
6 #include <pwd.h>
7+
8+#ifdef MACOSX
9+#include <sys/time.h>
10+#else
11 #include <sys/timeb.h>
12+#endif
13+
14 #include <sys/types.h>
15 #include <sys/stat.h>
16 #include <sys/wait.h>
17@@ -1056,7 +1062,11 @@
18     ssize_t bytesRead;
19     char readBuf [1025];
20     int readBufPos, childOutputBufferPos;
21+#ifdef MACOSX
22+    struct timeval timeBuffer;
23+#else
24     struct timeb timeBuffer;
25+#endif
26     long startTime;
27     int startTimeMillis;
28     long now;
29@@ -1064,9 +1074,15 @@
30     long durr;
31     
32     if (jvmOut != -1) {
33+#ifdef MACOSX
34+        gettimeofday(&timeBuffer, NULL);
35+        startTime = now = timeBuffer.tv_sec;
36+        startTimeMillis = nowMillis = timeBuffer.tv_usec / 1000;
37+#else
38         ftime( &timeBuffer );
39         startTime = now = timeBuffer.time;
40         startTimeMillis = nowMillis = timeBuffer.millitm;
41+#endif
42 
43         /*
44         log_printf(WRAPPER_SOURCE_WRAPPER, LEVEL_DEBUG, "now=%ld, nowMillis=%d", now, nowMillis);
45@@ -1159,9 +1175,15 @@
46             }
47 
48             /* Get the time again */
49+#ifdef MACOSX
50+            gettimeofday(&timeBuffer, NULL);
51+            now = timeBuffer.tv_sec;
52+            nowMillis = timeBuffer.tv_usec / 1000;
53+#else
54             ftime( &timeBuffer );
55             now = timeBuffer.time;
56             nowMillis = timeBuffer.millitm;
57+#endif
58         }
59     }
60     
Note: See TracBrowser for help on using the repository browser.