diff options
author | Nick Mathewson <nickm@torproject.org> | 2003-08-12 15:08:51 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2003-08-12 15:08:51 +0000 |
commit | 9cf01020cc305665dc8fae91bf7034c837d4e03d (patch) | |
tree | 7ded9853fb16fc812a70822ac8b417a24322a0bd | |
parent | bbd4032fc14fb23edf7633382ed26788523ac728 (diff) | |
download | tor-9cf01020cc305665dc8fae91bf7034c837d4e03d.tar tor-9cf01020cc305665dc8fae91bf7034c837d4e03d.tar.gz |
Misc patches to make windows build work. Now everything is done except the sockets stuff
svn:r393
-rw-r--r-- | src/or/directory.c | 2 | ||||
-rw-r--r-- | src/or/main.c | 10 | ||||
-rw-r--r-- | src/or/or.h | 4 | ||||
-rw-r--r-- | src/win32/orconfig.h | 2 |
4 files changed, 12 insertions, 6 deletions
diff --git a/src/or/directory.c b/src/or/directory.c index 98d207b26..1c4fb95b5 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -181,7 +181,7 @@ int directory_handle_command(connection_t *conn) { 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 */ } diff --git a/src/or/main.c b/src/or/main.c index 16a32e677..9206d7b78 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -513,10 +513,12 @@ static int do_main_loop(void) { * 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 int do_main_loop(void) { 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 @@ dump_signed_directory_to_string_impl(char *s, int maxlen, directory_t *dir, } void daemonize(void) { +#ifndef MS_WINDOWS /* Fork; parent exits. */ if (fork()) exit(0); @@ -837,6 +840,7 @@ void daemonize(void) { 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[]) { diff --git a/src/or/or.h b/src/or/or.h index 20177f6a4..6f0165487 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -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 diff --git a/src/win32/orconfig.h b/src/win32/orconfig.h index 18a31e7b4..3170f9e3e 100644 --- a/src/win32/orconfig.h +++ b/src/win32/orconfig.h @@ -2,6 +2,8 @@ * orconfig.h -- This file is *not* generated by autoconf. Instead, * it has to be hand-edited to keep win32 happy. */ +#define MS_WINDOWS +#define MS_WIN32 /* Define to 1 if you have the <arpa/inet.h> header file. */ #undef HAVE_ARPA_INET_H |