New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port for windows #18
Port for windows #18
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -545,7 +545,7 @@ void StopServer() | |
server.running = 0; | ||
} | ||
|
||
static void* serverConsole(void* arg) | ||
static void serverConsole(void* arg) | ||
{ | ||
(void) arg; | ||
char* buf; | ||
|
@@ -571,13 +571,14 @@ static void* serverConsole(void* arg) | |
rl_clear_history(); | ||
#endif | ||
|
||
server_sleep(5); // seconds | ||
StopServer(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not needed at all. Like it was there before. Rebase your commits. Dont fix up in later ones :| |
||
|
||
server_sleep(5); // wait 5 seconds for the server to stop | ||
|
||
// if this thread is not dead at this point, then we need to stop the server by force >:) | ||
LOG_ERROR("Server did not respond for 5 seconds. Killing it with fire..."); | ||
|
||
exit(-1); | ||
|
||
return 0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why ? |
||
} | ||
|
||
void StartServer(uint16 port, | ||
|
@@ -674,7 +675,7 @@ void StartServer(uint16 port, | |
|
||
rl_catch_signals = 0; | ||
pthread_t console; | ||
pthread_create(&console, NULL, serverConsole, NULL); | ||
pthread_create(&console, NULL, (void*)serverConsole, NULL); | ||
pthread_detach(console); | ||
|
||
signal(SIGINT, ReadlineNewLine); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
void server_sleep(uint64 seconds) | ||
{ | ||
#ifdef WIN32 | ||
Sleep(seconds * 1000); | ||
Sleep(seconds * 1000); // The sleep function in Windows is in milliseconds | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I mean kinda pointless comment. Its kinda obvious. |
||
#else | ||
sleep(seconds); | ||
#endif | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leave it as pointer please. Dont pretype it in the actual passtrough.