aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2006-09-06 08:42:16 +0000
committerNick Mathewson <nickm@torproject.org>2006-09-06 08:42:16 +0000
commit000b7b287c770ce4b7a88eaae5f87601d61faf4a (patch)
tree395103e1fa7d7679bd2ca706cdfa9ce57c960fa2
parentdffa692d059925b825e5d7122b45491943a606c3 (diff)
downloadtor-000b7b287c770ce4b7a88eaae5f87601d61faf4a.tar
tor-000b7b287c770ce4b7a88eaae5f87601d61faf4a.tar.gz
r8724@Kushana: nickm | 2006-09-06 04:32:28 -0400
Fix spaces; restore support for mapping files over 4GB on win32 (?) svn:r8326
-rw-r--r--src/common/compat.c28
-rw-r--r--src/common/compat.h2
-rw-r--r--src/or/config.c2
3 files changed, 13 insertions, 19 deletions
diff --git a/src/common/compat.c b/src/common/compat.c
index 12608bde2..44bb63f97 100644
--- a/src/common/compat.c
+++ b/src/common/compat.c
@@ -167,22 +167,22 @@ tor_mmap_file(const char *filename)
res->mmap_handle = res->file_handle = INVALID_HANDLE_VALUE;
res->file_handle = CreateFile(filename,
- GENERIC_READ,
- 0, NULL,
- OPEN_EXISTING,
- FILE_ATTRIBUTE_NORMAL,
- 0);
+ GENERIC_READ,
+ 0, NULL,
+ OPEN_EXISTING,
+ FILE_ATTRIBUTE_NORMAL,
+ 0);
if (res->file_handle == INVALID_HANDLE_VALUE)
- goto err;
+ goto err;
res->base.size = GetFileSize(res->file_handle, NULL);
res->mmap_handle = CreateFileMapping(res->file_handle,
NULL,
PAGE_READONLY,
- 0,
- res->base.size,
+ (res->base.size >> 32),
+ (res->base.size & 0xfffffffful),
NULL);
if (res->mmap_handle != INVALID_HANDLE_VALUE)
goto err;
@@ -426,8 +426,8 @@ void
set_socket_nonblocking(int socket)
{
#ifdef MS_WINDOWS
- unsigned long nonblocking = 1;
- ioctlsocket(socket, FIONBIO, (unsigned long*) &nonblocking);
+ unsigned long nonblocking = 1;
+ ioctlsocket(socket, FIONBIO, (unsigned long*) &nonblocking);
#else
fcntl(socket, F_SETFL, O_NONBLOCK);
#endif
@@ -572,7 +572,7 @@ set_max_file_descriptors(unsigned long limit, unsigned long cap)
log_fn(LOG_INFO, LD_NET,
"This platform is missing getrlimit(). Proceeding.");
if (limit < cap) {
- log_info(LD_CONFIG, "ConnLimit must be at most %d. Using that.", (int) cap);
+ log_info(LD_CONFIG, "ConnLimit must be at most %d. Using that.", (int)cap);
limit = cap;
}
#else
@@ -809,8 +809,6 @@ static int uname_result_is_set = 0;
const char *
get_uname(void)
{
-
-
#ifdef HAVE_UNAME
struct utsname u;
#endif
@@ -864,7 +862,6 @@ get_uname(void)
memset(&info, 0, sizeof(info));
info.dwOSVersionInfoSize = sizeof(info);
if (! GetVersionEx((LPOSVERSIONINFO)&info)) {
-
strlcpy(uname_result, "Bizarre version of Windows where GetVersionEx"
" doesn't work.", sizeof(uname_result));
uname_result_is_set = 1;
@@ -1004,7 +1001,6 @@ spawn_func(void (*func)(void *), void *data)
/** End the current thread/process.
*/
-
void
spawn_exit(void)
{
@@ -1161,7 +1157,7 @@ tor_mutex_acquire(tor_mutex_t *m)
tor_assert(0);
break;
case WAIT_FAILED:
- log_warn(LD_GENERAL, "Failed to acquire mutex: %d", (int) GetLastError());
+ log_warn(LD_GENERAL, "Failed to acquire mutex: %d",(int) GetLastError());
}
}
void
diff --git a/src/common/compat.h b/src/common/compat.h
index 0aff0775e..7ed2e62e6 100644
--- a/src/common/compat.h
+++ b/src/common/compat.h
@@ -319,9 +319,7 @@ unsigned long tor_get_thread_id(void);
#define VER_SUITE_SINGLEUSERTS 0x00000100
#endif
-
#endif
-
#endif
diff --git a/src/or/config.c b/src/or/config.c
index 146107ead..d6c4a1efc 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -2761,7 +2761,7 @@ options_init_from_torrc(int argc, char **argv)
fname = tor_strdup(dflt);
} else {
#ifndef MS_WINDOWS
- char *fn;
+ char *fn;
fn = expand_filename("~/.torrc");
if (fn && file_status(fn) == FN_FILE) {
fname = fn;