projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Don't complain about garbage if we skipped importing a host file.
[tinc]
/
src
/
process.c
diff --git
a/src/process.c
b/src/process.c
index
19c0582
..
2fd3d93
100644
(file)
--- a/
src/process.c
+++ b/
src/process.c
@@
-1,7
+1,7
@@
/*
process.c -- process management functions
Copyright (C) 1999-2005 Ivo Timmermans,
/*
process.c -- process management functions
Copyright (C) 1999-2005 Ivo Timmermans,
- 2000-201
1
Guus Sliepen <guus@tinc-vpn.org>
+ 2000-201
2
Guus Sliepen <guus@tinc-vpn.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-25,6
+25,7
@@
#include "control.h"
#include "device.h"
#include "edge.h"
#include "control.h"
#include "device.h"
#include "edge.h"
+#include "event.h"
#include "logger.h"
#include "net.h"
#include "node.h"
#include "logger.h"
#include "net.h"
#include "node.h"
@@
-73,7
+74,7
@@
static bool install_service(void) {
strncat(command, "\"", sizeof command - strlen(command));
for(char **argp = g_argv + 1; *argp; argp++) {
strncat(command, "\"", sizeof command - strlen(command));
for(char **argp = g_argv + 1; *argp; argp++) {
- char
&
space = strchr(*argp, ' ');
+ char
*
space = strchr(*argp, ' ');
strncat(command, " ", sizeof command - strlen(command));
if(space)
strncat(command, " ", sizeof command - strlen(command));
if(space)
@@
-123,11
+124,11
@@
DWORD WINAPI controlhandler(DWORD request, DWORD type, LPVOID boe, LPVOID bah) {
logger(DEBUG_ALWAYS, LOG_NOTICE, "Got %s request", "SERVICE_CONTROL_SHUTDOWN");
break;
default:
logger(DEBUG_ALWAYS, LOG_NOTICE, "Got %s request", "SERVICE_CONTROL_SHUTDOWN");
break;
default:
- logger(DEBUG_ALWAYS, LOG_WARNING, "Got unexpected request %d", request);
+ logger(DEBUG_ALWAYS, LOG_WARNING, "Got unexpected request %d",
(int)
request);
return ERROR_CALL_NOT_IMPLEMENTED;
}
return ERROR_CALL_NOT_IMPLEMENTED;
}
- event_
loopexit(NULL
);
+ event_
exit(
);
status.dwWaitHint = 30000;
status.dwCurrentState = SERVICE_STOP_PENDING;
SetServiceStatus(statushandle, &status);
status.dwWaitHint = 30000;
status.dwCurrentState = SERVICE_STOP_PENDING;
SetServiceStatus(statushandle, &status);
@@
-135,10
+136,8
@@
DWORD WINAPI controlhandler(DWORD request, DWORD type, LPVOID boe, LPVOID bah) {
}
VOID WINAPI run_service(DWORD argc, LPTSTR* argv) {
}
VOID WINAPI run_service(DWORD argc, LPTSTR* argv) {
- int err = 1;
extern int main2(int argc, char **argv);
extern int main2(int argc, char **argv);
-
status.dwServiceType = SERVICE_WIN32;
status.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN;
status.dwWin32ExitCode = 0;
status.dwServiceType = SERVICE_WIN32;
status.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN;
status.dwWin32ExitCode = 0;
@@
-149,7
+148,6
@@
VOID WINAPI run_service(DWORD argc, LPTSTR* argv) {
if (!statushandle) {
logger(DEBUG_ALWAYS, LOG_ERR, "System call `%s' failed: %s", "RegisterServiceCtrlHandlerEx", winerror(GetLastError()));
if (!statushandle) {
logger(DEBUG_ALWAYS, LOG_ERR, "System call `%s' failed: %s", "RegisterServiceCtrlHandlerEx", winerror(GetLastError()));
- err = 1;
} else {
status.dwWaitHint = 30000;
status.dwCurrentState = SERVICE_START_PENDING;
} else {
status.dwWaitHint = 30000;
status.dwCurrentState = SERVICE_START_PENDING;
@@
-159,11
+157,10
@@
VOID WINAPI run_service(DWORD argc, LPTSTR* argv) {
status.dwCurrentState = SERVICE_RUNNING;
SetServiceStatus(statushandle, &status);
status.dwCurrentState = SERVICE_RUNNING;
SetServiceStatus(statushandle, &status);
-
err =
main2(argc, argv);
+ main2(argc, argv);
status.dwWaitHint = 0;
status.dwCurrentState = SERVICE_STOPPED;
status.dwWaitHint = 0;
status.dwCurrentState = SERVICE_STOPPED;
- //status.dwWin32ExitCode = err;
SetServiceStatus(statushandle, &status);
}
SetServiceStatus(statushandle, &status);
}