Commit 814e49d3 authored by Sven Gestegård Robertz's avatar Sven Gestegård Robertz
Browse files

small cleanup

parent 4ad8c9cd
......@@ -435,8 +435,8 @@ static void join_bg_thread(pthread_t* bg_thread, const char* msg)
static void client_init(struct client* client)
{
client->cam=0;
client->connfd=0;
client->cam=NULL;
client->connfd=-1;
}
int serve_clients(struct global_state* state)
{
......@@ -484,11 +484,11 @@ failed_to_alloc_client:
void init_global_state(struct global_state* state)
{
pthread_mutex_lock(&global_mutex);
pthread_mutex_lock(&global_mutex);
state->running=0;
state->quit=0;
state->cam=NULL;
pthread_mutex_unlock(&global_mutex);
pthread_mutex_unlock(&global_mutex);
}
int is_running(struct global_state* state)
......
......@@ -104,10 +104,6 @@ struct client{
static int client_write_string(struct client* client);
/////////////// client stuff
struct client;
pthread_mutex_t global_mutex = PTHREAD_MUTEX_INITIALIZER;
pthread_cond_t global_cond = PTHREAD_COND_INITIALIZER;
......@@ -493,12 +489,12 @@ failed_poll:
void init_global_state(struct global_state* state)
{
pthread_mutex_lock(&global_mutex);
pthread_mutex_lock(&global_mutex);
state->running=0;
state->quit=0;
state->t_local=0;
state->t_remote=0;
pthread_mutex_unlock(&global_mutex);
pthread_mutex_unlock(&global_mutex);
}
int create_socket(struct global_state* state)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment