diff options
author | Sebastian Hahn <sebastian@torproject.org> | 2010-12-26 12:13:47 +0100 |
---|---|---|
committer | Sebastian Hahn <sebastian@torproject.org> | 2010-12-27 09:47:41 +0100 |
commit | 9ecf133686c8907baec2292ca612ee11aa18406e (patch) | |
tree | 58ab4df2a31b975f4eb7d18689cc66cb4b2a0d8e /src/or | |
parent | e895919b171029df4d38285b0be4483376b4ad25 (diff) | |
download | tor-9ecf133686c8907baec2292ca612ee11aa18406e.tar.gz tor-9ecf133686c8907baec2292ca612ee11aa18406e.zip |
Fix compile wanrings revealed by gcc 4.5 on mingw
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/cpuworker.c | 2 | ||||
-rw-r--r-- | src/or/eventdns.c | 8 | ||||
-rw-r--r-- | src/or/ntmain.c | 6 |
3 files changed, 9 insertions, 7 deletions
diff --git a/src/or/cpuworker.c b/src/or/cpuworker.c index ae8d69f6ec..fecad1489f 100644 --- a/src/or/cpuworker.c +++ b/src/or/cpuworker.c @@ -250,7 +250,7 @@ cpuworker_main(void *data) for (;;) { ssize_t r; - if ((r = recv(fd, &question_type, 1, 0)) != 1) { + if ((r = recv(fd, (void *)&question_type, 1, 0)) != 1) { // log_fn(LOG_ERR,"read type failed. Exiting."); if (r == 0) { log_info(LD_OR, diff --git a/src/or/eventdns.c b/src/or/eventdns.c index b929303fd5..75a25bd088 100644 --- a/src/or/eventdns.c +++ b/src/or/eventdns.c @@ -1245,7 +1245,8 @@ nameserver_read(struct nameserver *ns) { for (;;) { const int r = - (int)recvfrom(ns->socket, packet, (socklen_t)sizeof(packet), 0, + (int)recvfrom(ns->socket, (void*)packet, + (socklen_t)sizeof(packet), 0, sa, &addrlen); if (r < 0) { int err = last_error(ns->socket); @@ -1276,7 +1277,7 @@ server_port_read(struct evdns_server_port *s) { for (;;) { addrlen = (socklen_t)sizeof(struct sockaddr_storage); - r = recvfrom(s->socket, packet, sizeof(packet), 0, + r = recvfrom(s->socket, (void*)packet, sizeof(packet), 0, (struct sockaddr*) &addr, &addrlen); if (r < 0) { int err = last_error(s->socket); @@ -2012,7 +2013,8 @@ evdns_request_timeout_callback(int fd, short events, void *arg) { /* 2 other failure */ static int evdns_request_transmit_to(struct evdns_request *req, struct nameserver *server) { - const ssize_t r = send(server->socket, req->request, req->request_len, 0); + const ssize_t r = send(server->socket, (void*)req->request, + req->request_len, 0); if (r < 0) { int err = last_error(server->socket); if (error_is_eagain(err)) return 1; diff --git a/src/or/ntmain.c b/src/or/ntmain.c index 46e7afb78b..984acc7839 100644 --- a/src/or/ntmain.c +++ b/src/or/ntmain.c @@ -518,7 +518,7 @@ nt_service_install(int argc, char **argv) SERVICE_DESCRIPTIONA sdBuff; char *command; char *errmsg; - const char *user_acct = GENSRV_USERACCT; + const char *user_acct = NULL; const char *password = ""; int i; OSVERSIONINFOEX info; @@ -562,13 +562,12 @@ nt_service_install(int argc, char **argv) is_win2k_or_worse = 1; } - if (user_acct == GENSRV_USERACCT) { + if (!user_acct) { if (is_win2k_or_worse) { /* On Win2k, there is no LocalService account, so we actually need to * fall back on NULL (the system account). */ printf("Running on Win2K or earlier, so the LocalService account " "doesn't exist. Falling back to SYSTEM account.\n"); - user_acct = NULL; } else { /* Genericity is apparently _so_ last year in Redmond, where some * accounts are accounts that you can look up, and some accounts @@ -577,6 +576,7 @@ nt_service_install(int argc, char **argv) */ printf("Running on a Post-Win2K OS, so we'll assume that the " "LocalService account exists.\n"); + user_acct = GENSRV_USERACCT; } } else if (0 && service_fns.LookupAccountNameA_fn(NULL, // On this system user_acct, |