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