Skip to content
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

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 6 additions & 5 deletions Source/Server.c
Expand Up @@ -545,7 +545,7 @@ void StopServer()
server.running = 0;
}

static void* serverConsole(void* arg)
static void serverConsole(void* arg)
Copy link
Contributor

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.

{
(void) arg;
char* buf;
Expand All @@ -571,13 +571,14 @@ static void* serverConsole(void* arg)
rl_clear_history();
#endif

server_sleep(5); // seconds
StopServer();
Copy link
Contributor

Choose a reason for hiding this comment

The 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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why ?

}

void StartServer(uint16 port,
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion Source/Util/Functions.c
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean kinda pointless comment. Its kinda obvious.

#else
sleep(seconds);
#endif
Expand Down