Loading changes/bug2314 0 → 100644 +4 −0 Changes for changes/bug2314: 4 added lines, 0 removed lines. Original line number Original line Diff line number Diff line o Minor bugfixes: - Fix a bunch of compile warnings revealed by mingw with gcc 4.5. Fixes bug 2314. src/common/crypto.c +2 −1 Changes for src/common/crypto.c: 2 added lines, 1 removed line. Original line number Original line Diff line number Diff line Loading @@ -1959,14 +1959,15 @@ seed_weak_rng(void) int int crypto_seed_rng(int startup) crypto_seed_rng(int startup) { { char buf[ADD_ENTROPY]; int rand_poll_status = 0; int rand_poll_status = 0; /* local variables */ /* local variables */ #ifdef MS_WINDOWS #ifdef MS_WINDOWS unsigned char buf[ADD_ENTROPY]; static int provider_set = 0; static int provider_set = 0; static HCRYPTPROV provider; static HCRYPTPROV provider; #else #else char buf[ADD_ENTROPY]; static const char *filenames[] = { static const char *filenames[] = { "/dev/srandom", "/dev/urandom", "/dev/random", NULL "/dev/srandom", "/dev/urandom", "/dev/random", NULL }; }; Loading src/or/cpuworker.c +1 −1 Changes for src/or/cpuworker.c: 1 added line, 1 removed line. Original line number Original line Diff line number Diff line Loading @@ -249,7 +249,7 @@ cpuworker_main(void *data) for (;;) { for (;;) { ssize_t r; 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."); // log_fn(LOG_ERR,"read type failed. Exiting."); if (r == 0) { if (r == 0) { log_info(LD_OR, log_info(LD_OR, Loading src/or/eventdns.c +5 −3 Changes for src/or/eventdns.c: 5 added lines, 3 removed lines. Original line number Original line Diff line number Diff line Loading @@ -1245,7 +1245,8 @@ nameserver_read(struct nameserver *ns) { for (;;) { for (;;) { const int r = 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); sa, &addrlen); if (r < 0) { if (r < 0) { int err = last_error(ns->socket); int err = last_error(ns->socket); Loading Loading @@ -1276,7 +1277,7 @@ server_port_read(struct evdns_server_port *s) { for (;;) { for (;;) { addrlen = (socklen_t)sizeof(struct sockaddr_storage); 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); (struct sockaddr*) &addr, &addrlen); if (r < 0) { if (r < 0) { int err = last_error(s->socket); int err = last_error(s->socket); Loading Loading @@ -2012,7 +2013,8 @@ evdns_request_timeout_callback(int fd, short events, void *arg) { /* 2 other failure */ /* 2 other failure */ static int static int evdns_request_transmit_to(struct evdns_request *req, struct nameserver *server) { 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) { if (r < 0) { int err = last_error(server->socket); int err = last_error(server->socket); if (error_is_eagain(err)) return 1; if (error_is_eagain(err)) return 1; Loading src/or/ntmain.c +3 −3 Changes for src/or/ntmain.c: 3 added lines, 3 removed lines. Original line number Original line Diff line number Diff line Loading @@ -517,7 +517,7 @@ nt_service_install(int argc, char **argv) SERVICE_DESCRIPTIONA sdBuff; SERVICE_DESCRIPTIONA sdBuff; char *command; char *command; char *errmsg; char *errmsg; const char *user_acct = GENSRV_USERACCT; const char *user_acct = NULL; const char *password = ""; const char *password = ""; int i; int i; OSVERSIONINFOEX info; OSVERSIONINFOEX info; Loading Loading @@ -561,13 +561,12 @@ nt_service_install(int argc, char **argv) is_win2k_or_worse = 1; is_win2k_or_worse = 1; } } if (user_acct == GENSRV_USERACCT) { if (!user_acct) { if (is_win2k_or_worse) { if (is_win2k_or_worse) { /* On Win2k, there is no LocalService account, so we actually need to /* On Win2k, there is no LocalService account, so we actually need to * fall back on NULL (the system account). */ * fall back on NULL (the system account). */ printf("Running on Win2K or earlier, so the LocalService account " printf("Running on Win2K or earlier, so the LocalService account " "doesn't exist. Falling back to SYSTEM account.\n"); "doesn't exist. Falling back to SYSTEM account.\n"); user_acct = NULL; } else { } else { /* Genericity is apparently _so_ last year in Redmond, where some /* Genericity is apparently _so_ last year in Redmond, where some * accounts are accounts that you can look up, and some accounts * accounts are accounts that you can look up, and some accounts Loading @@ -576,6 +575,7 @@ nt_service_install(int argc, char **argv) */ */ printf("Running on a Post-Win2K OS, so we'll assume that the " printf("Running on a Post-Win2K OS, so we'll assume that the " "LocalService account exists.\n"); "LocalService account exists.\n"); user_acct = GENSRV_USERACCT; } } } else if (0 && service_fns.LookupAccountNameA_fn(NULL, // On this system } else if (0 && service_fns.LookupAccountNameA_fn(NULL, // On this system user_acct, user_acct, Loading Loading
changes/bug2314 0 → 100644 +4 −0 Changes for changes/bug2314: 4 added lines, 0 removed lines. Original line number Original line Diff line number Diff line o Minor bugfixes: - Fix a bunch of compile warnings revealed by mingw with gcc 4.5. Fixes bug 2314.
src/common/crypto.c +2 −1 Changes for src/common/crypto.c: 2 added lines, 1 removed line. Original line number Original line Diff line number Diff line Loading @@ -1959,14 +1959,15 @@ seed_weak_rng(void) int int crypto_seed_rng(int startup) crypto_seed_rng(int startup) { { char buf[ADD_ENTROPY]; int rand_poll_status = 0; int rand_poll_status = 0; /* local variables */ /* local variables */ #ifdef MS_WINDOWS #ifdef MS_WINDOWS unsigned char buf[ADD_ENTROPY]; static int provider_set = 0; static int provider_set = 0; static HCRYPTPROV provider; static HCRYPTPROV provider; #else #else char buf[ADD_ENTROPY]; static const char *filenames[] = { static const char *filenames[] = { "/dev/srandom", "/dev/urandom", "/dev/random", NULL "/dev/srandom", "/dev/urandom", "/dev/random", NULL }; }; Loading
src/or/cpuworker.c +1 −1 Changes for src/or/cpuworker.c: 1 added line, 1 removed line. Original line number Original line Diff line number Diff line Loading @@ -249,7 +249,7 @@ cpuworker_main(void *data) for (;;) { for (;;) { ssize_t r; 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."); // log_fn(LOG_ERR,"read type failed. Exiting."); if (r == 0) { if (r == 0) { log_info(LD_OR, log_info(LD_OR, Loading
src/or/eventdns.c +5 −3 Changes for src/or/eventdns.c: 5 added lines, 3 removed lines. Original line number Original line Diff line number Diff line Loading @@ -1245,7 +1245,8 @@ nameserver_read(struct nameserver *ns) { for (;;) { for (;;) { const int r = 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); sa, &addrlen); if (r < 0) { if (r < 0) { int err = last_error(ns->socket); int err = last_error(ns->socket); Loading Loading @@ -1276,7 +1277,7 @@ server_port_read(struct evdns_server_port *s) { for (;;) { for (;;) { addrlen = (socklen_t)sizeof(struct sockaddr_storage); 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); (struct sockaddr*) &addr, &addrlen); if (r < 0) { if (r < 0) { int err = last_error(s->socket); int err = last_error(s->socket); Loading Loading @@ -2012,7 +2013,8 @@ evdns_request_timeout_callback(int fd, short events, void *arg) { /* 2 other failure */ /* 2 other failure */ static int static int evdns_request_transmit_to(struct evdns_request *req, struct nameserver *server) { 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) { if (r < 0) { int err = last_error(server->socket); int err = last_error(server->socket); if (error_is_eagain(err)) return 1; if (error_is_eagain(err)) return 1; Loading
src/or/ntmain.c +3 −3 Changes for src/or/ntmain.c: 3 added lines, 3 removed lines. Original line number Original line Diff line number Diff line Loading @@ -517,7 +517,7 @@ nt_service_install(int argc, char **argv) SERVICE_DESCRIPTIONA sdBuff; SERVICE_DESCRIPTIONA sdBuff; char *command; char *command; char *errmsg; char *errmsg; const char *user_acct = GENSRV_USERACCT; const char *user_acct = NULL; const char *password = ""; const char *password = ""; int i; int i; OSVERSIONINFOEX info; OSVERSIONINFOEX info; Loading Loading @@ -561,13 +561,12 @@ nt_service_install(int argc, char **argv) is_win2k_or_worse = 1; is_win2k_or_worse = 1; } } if (user_acct == GENSRV_USERACCT) { if (!user_acct) { if (is_win2k_or_worse) { if (is_win2k_or_worse) { /* On Win2k, there is no LocalService account, so we actually need to /* On Win2k, there is no LocalService account, so we actually need to * fall back on NULL (the system account). */ * fall back on NULL (the system account). */ printf("Running on Win2K or earlier, so the LocalService account " printf("Running on Win2K or earlier, so the LocalService account " "doesn't exist. Falling back to SYSTEM account.\n"); "doesn't exist. Falling back to SYSTEM account.\n"); user_acct = NULL; } else { } else { /* Genericity is apparently _so_ last year in Redmond, where some /* Genericity is apparently _so_ last year in Redmond, where some * accounts are accounts that you can look up, and some accounts * accounts are accounts that you can look up, and some accounts Loading @@ -576,6 +575,7 @@ nt_service_install(int argc, char **argv) */ */ printf("Running on a Post-Win2K OS, so we'll assume that the " printf("Running on a Post-Win2K OS, so we'll assume that the " "LocalService account exists.\n"); "LocalService account exists.\n"); user_acct = GENSRV_USERACCT; } } } else if (0 && service_fns.LookupAccountNameA_fn(NULL, // On this system } else if (0 && service_fns.LookupAccountNameA_fn(NULL, // On this system user_acct, user_acct, Loading