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:
Guus Sliepen 2003-08-02 20:50:38 +00:00
parent 7c34122af7
commit f08fc359a0
9 changed files with 410 additions and 175 deletions

View file

@ -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

View file

@ -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__ */