mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-23 14:40:51 +01:00
r12001@catbus: nickm | 2007-02-28 15:24:12 -0500
Try to build without warnings on mingw with verbose warnings on. First attempt. svn:r9688
This commit is contained in:
parent
3008c3b768
commit
f38240435a
5 changed files with 33 additions and 9 deletions
|
@ -713,6 +713,9 @@ switch_id(const char *user, const char *group)
|
|||
}
|
||||
|
||||
return 0;
|
||||
#else
|
||||
(void)user;
|
||||
(void)group;
|
||||
#endif
|
||||
|
||||
log_warn(LD_CONFIG,
|
||||
|
@ -878,7 +881,7 @@ get_uname(void)
|
|||
unsigned int leftover_mask;
|
||||
const char *plat = NULL;
|
||||
static struct {
|
||||
int major; int minor; const char *version;
|
||||
unsigned major; unsigned minor; const char *version;
|
||||
} win_version_table[] = {
|
||||
{ 6, 0, "Windows \"Longhorn\"" },
|
||||
{ 5, 2, "Windows Server 2003" },
|
||||
|
@ -889,7 +892,7 @@ get_uname(void)
|
|||
{ 4, 10, "Windows 98" },
|
||||
/* { 4, 0, "Windows 95" } */
|
||||
{ 3, 51, "Windows NT 3.51" },
|
||||
{ -1, -1, NULL }
|
||||
{ 0, 0, NULL }
|
||||
};
|
||||
#ifdef VER_SUITE_BACKOFFICE
|
||||
static struct {
|
||||
|
@ -924,7 +927,7 @@ get_uname(void)
|
|||
else
|
||||
plat = "Windows 95";
|
||||
} else {
|
||||
for (i=0; win_version_table[i].major>=0; ++i) {
|
||||
for (i=0; win_version_table[i].major>0; ++i) {
|
||||
if (win_version_table[i].major == info.dwMajorVersion &&
|
||||
win_version_table[i].minor == info.dwMinorVersion) {
|
||||
plat = win_version_table[i].version;
|
||||
|
@ -1027,8 +1030,8 @@ spawn_func(void (*func)(void *), void *data)
|
|||
{
|
||||
#if defined(USE_WIN32_THREADS)
|
||||
int rv;
|
||||
rv = _beginthread(func, 0, data);
|
||||
if (rv == (unsigned long) -1)
|
||||
rv = (int)_beginthread(func, 0, data);
|
||||
if (rv == (int)-1)
|
||||
return -1;
|
||||
return 0;
|
||||
#elif defined(USE_PTHREADS)
|
||||
|
|
|
@ -1567,7 +1567,7 @@ crypto_seed_rng(void)
|
|||
if (!provider_set) {
|
||||
if (!CryptAcquireContext(&provider, NULL, NULL, PROV_RSA_FULL,
|
||||
CRYPT_VERIFYCONTEXT)) {
|
||||
if (GetLastError() != NTE_BAD_KEYSET) {
|
||||
if ((unsigned long)GetLastError() != (unsigned long)NTE_BAD_KEYSET) {
|
||||
log_warn(LD_CRYPTO, "Can't get CryptoAPI provider [1]");
|
||||
return rand_poll_status ? 0 : -1;
|
||||
}
|
||||
|
|
|
@ -2070,6 +2070,7 @@ start_daemon(void)
|
|||
void
|
||||
finish_daemon(const char *cp)
|
||||
{
|
||||
(void)cp;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -714,7 +714,7 @@ reply_handle(struct request *const req, u16 flags, u32 ttl, struct reply *reply)
|
|||
/*XXXX refactor the parts of */
|
||||
log(EVDNS_LOG_DEBUG, "Got a SERVERFAILED from nameserver %s; "
|
||||
"will allow the request to time out.",
|
||||
debug_nota(req->ns->address));
|
||||
debug_ntoa(req->ns->address));
|
||||
break;
|
||||
default:
|
||||
// we got a good reply from the nameserver
|
||||
|
@ -2559,6 +2559,7 @@ evdns_resolv_set_defaults(int flags) {
|
|||
#ifndef HAVE_STRTOK_R
|
||||
static char *
|
||||
strtok_r(char *s, const char *delim, char **state) {
|
||||
(void)state;
|
||||
return strtok(s, delim);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1576,6 +1576,8 @@ handle_signals(int is_parent)
|
|||
sigaction(SIGXFSZ, &action, NULL);
|
||||
#endif
|
||||
}
|
||||
#else /* MS windows */
|
||||
(void)is_parent;
|
||||
#endif /* signal stuff */
|
||||
}
|
||||
|
||||
|
@ -1739,6 +1741,20 @@ do_hash_password(void)
|
|||
|
||||
#ifdef MS_WINDOWS_SERVICE
|
||||
|
||||
/* XXXX can some/all these functions become static? without breaing NT
|
||||
* services? */
|
||||
void nt_service_control(DWORD request);
|
||||
void nt_service_body(int argc, char **argv);
|
||||
void nt_service_main(void);
|
||||
SC_HANDLE nt_service_open_scm(void);
|
||||
SC_HANDLE nt_service_open(SC_HANDLE hSCManager);
|
||||
int nt_service_start(SC_HANDLE hService);
|
||||
int nt_service_stop(SC_HANDLE hService);
|
||||
int nt_service_install(int argc, char **argv);
|
||||
int nt_service_remove(void);
|
||||
int nt_service_cmd_start(void);
|
||||
int nt_service_cmd_stop(void);
|
||||
|
||||
struct service_fns {
|
||||
int loaded;
|
||||
|
||||
|
@ -1917,6 +1933,8 @@ void
|
|||
nt_service_body(int argc, char **argv)
|
||||
{
|
||||
int r;
|
||||
(void) argc; /* unused */
|
||||
(void) argv; /* unused */
|
||||
nt_service_loadlibrary();
|
||||
service_status.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
|
||||
service_status.dwCurrentState = SERVICE_START_PENDING;
|
||||
|
@ -1962,7 +1980,7 @@ nt_service_main(void)
|
|||
DWORD result = 0;
|
||||
char *errmsg;
|
||||
nt_service_loadlibrary();
|
||||
table[0].lpServiceName = GENSRV_SERVICENAME;
|
||||
table[0].lpServiceName = (char*)GENSRV_SERVICENAME;
|
||||
table[0].lpServiceProc = (LPSERVICE_MAIN_FUNCTION)nt_service_body;
|
||||
table[1].lpServiceName = NULL;
|
||||
table[1].lpServiceProc = NULL;
|
||||
|
@ -1988,6 +2006,7 @@ nt_service_main(void)
|
|||
case CMD_VERIFY_CONFIG:
|
||||
printf("Configuration was valid\n");
|
||||
break;
|
||||
case CMD_RUN_UNITTESTS:
|
||||
default:
|
||||
log_err(LD_CONFIG, "Illegal command number %d: internal error.",
|
||||
get_options()->command);
|
||||
|
@ -2285,7 +2304,7 @@ nt_service_install(int argc, char **argv)
|
|||
printf("Done with CreateService.\n");
|
||||
|
||||
/* Set the service's description */
|
||||
sdBuff.lpDescription = GENSRV_DESCRIPTION;
|
||||
sdBuff.lpDescription = (char*)GENSRV_DESCRIPTION;
|
||||
service_fns.ChangeServiceConfig2A_fn(hService, SERVICE_CONFIG_DESCRIPTION,
|
||||
&sdBuff);
|
||||
printf("Service installed successfully\n");
|
||||
|
|
Loading…
Add table
Reference in a new issue