[or-cvs] Misc patches to make windows build work. Now everything is...

Nick Mathewson nickm at seul.org
Tue Aug 12 15:08:54 UTC 2003


Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/tmp/cvs-serv22162/src/or

Modified Files:
	directory.c main.c or.h 
Log Message:
Misc patches to make windows build work.  Now everything is done except the sockets stuff

Index: directory.c
===================================================================
RCS file: /home/or/cvsroot/src/or/directory.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- directory.c	12 Aug 2003 03:16:15 -0000	1.20
+++ directory.c	12 Aug 2003 15:08:51 -0000	1.21
@@ -181,7 +181,7 @@
 
   assert(conn && conn->type == CONN_TYPE_DIR);
 
-  if(conn->inbuf_datalen < strlen(getstring)) { /* entire response available? */
+  if(conn->inbuf_datalen < (int)strlen(getstring)) { /* entire response available? */
     log_fn(LOG_DEBUG,"Entire command not here yet. Waiting.");
     return 0; /* not yet */
   }

Index: main.c
===================================================================
RCS file: /home/or/cvsroot/src/or/main.c,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -d -r1.81 -r1.82
--- main.c	12 Aug 2003 08:04:31 -0000	1.81
+++ main.c	12 Aug 2003 15:08:51 -0000	1.82
@@ -513,10 +513,12 @@
    * non-zero. This is where we try to connect to all the other ORs,
    * and start the listeners
    */
-  retry_all_connections(options.ORPort, options.APPort, options.DirPort);
+  retry_all_connections((uint16_t) options.ORPort,
+	                    (uint16_t) options.APPort,
+						(uint16_t) options.DirPort);
 
   for(;;) {
-#ifndef MS_WINDOWS /* do signal stuff only on unix */
+#ifndef MS_WIN32 /* do signal stuff only on unix */
     if(please_dumpstats) {
       dumpstats();
       please_dumpstats = 0;
@@ -588,7 +590,7 @@
 
 static void catch(int the_signal) {
 
-#ifndef MS_WINDOWS /* do signal stuff only on unix */
+#ifndef MS_WIN32 /* do signal stuff only on unix */
   switch(the_signal) {
 //    case SIGABRT:
     case SIGTERM:
@@ -822,6 +824,7 @@
 }
 
 void daemonize(void) {
+#ifndef MS_WINDOWS
   /* Fork; parent exits. */
   if (fork())
     exit(0);
@@ -837,6 +840,7 @@
   fclose(stdin);
   fclose(stdout); /* XXX Nick: this closes our log, right? is it safe to leave this open? */
   fclose(stderr);
+#endif
 }
 
 int tor_main(int argc, char *argv[]) {

Index: or.h
===================================================================
RCS file: /home/or/cvsroot/src/or/or.h,v
retrieving revision 1.104
retrieving revision 1.105
diff -u -d -r1.104 -r1.105
--- or.h	12 Aug 2003 06:41:53 -0000	1.104
+++ or.h	12 Aug 2003 15:08:51 -0000	1.105
@@ -82,11 +82,11 @@
 #include <winsock.h>
 #endif
 
-#ifdef _MSC_VER
+#ifdef MS_WINDOWS
 #include <io.h>
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
-#define snprintf
+#define snprintf _snprintf
 #endif
 
 



More information about the tor-commits mailing list