Install tinc as a service under Windows (MinGW). Remove cleanup_and_exit(),
either exit() directly on errors or let main_loop() shutdown gracefully.
This commit is contained in:
parent
7c34122af7
commit
f08fc359a0
9 changed files with 410 additions and 175 deletions
14
lib/utils.c
14
lib/utils.c
|
@ -79,3 +79,17 @@ void cp_trace()
|
|||
);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MINGW
|
||||
char *winerror(int err) {
|
||||
static char buf[1024];
|
||||
|
||||
if (!FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
|
||||
NULL, err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), buf, sizeof(buf), NULL)) {
|
||||
strncpy(buf, _("(unable to format errormessage)"), sizeof(buf));
|
||||
};
|
||||
|
||||
return buf;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -38,4 +38,8 @@ extern void cp_trace(void);
|
|||
extern void hex2bin(char *src, char *dst, int length);
|
||||
extern void bin2hex(char *src, char *dst, int length);
|
||||
|
||||
#ifdef HAVE_MINGW
|
||||
extern char *winerror(int);
|
||||
#endif
|
||||
|
||||
#endif /* __TINC_UTILS_H__ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue