diff options
author | Johann Latocha | 2012-02-02 01:13:50 +0100 |
---|---|---|
committer | Johann Latocha | 2012-02-02 01:13:50 +0100 |
commit | 37e4ed696b77455a738fa948b93498c8740721bc (patch) | |
tree | 14306f376ef7132d2cac1624e3aafa8dbba035b0 /src/server/server.c | |
parent | [SERVER] Close all client sockets on shutdown (diff) | |
download | dnbd3-37e4ed696b77455a738fa948b93498c8740721bc.tar.gz dnbd3-37e4ed696b77455a738fa948b93498c8740721bc.tar.xz dnbd3-37e4ed696b77455a738fa948b93498c8740721bc.zip |
[SERVER] Parsing config file with glib
[KERNEL] Bugfixes
[CLIENT] Using vid and rid
Diffstat (limited to 'src/server/server.c')
-rw-r--r-- | src/server/server.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/server/server.c b/src/server/server.c index ad4c20b..a324682 100644 --- a/src/server/server.c +++ b/src/server/server.c @@ -31,15 +31,16 @@ #include "server.h" #include "utils.h" -#include "hashtable.h" #include "signal.h" #include "net.h" int _sock; +GSList *_dnbd3_clients = NULL; pthread_spinlock_t _spinlock; char *_config_file_name = DEFAULT_CONFIG_FILE; -GSList *_dnbd3_clients = NULL; +dnbd3_image_t *_images; +size_t _num_images = 0; void dnbd3_print_help(char* argv_0) { @@ -66,7 +67,7 @@ void dnbd3_cleanup() GSList *iterator = NULL; for (iterator = _dnbd3_clients; iterator; iterator = iterator->next) { - dnbd3_client_t *client = iterator->data; + dnbd3_client_t *client = iterator->data; shutdown(client->sock, SHUT_RDWR); pthread_join(*client->thread, NULL); } @@ -74,6 +75,7 @@ void dnbd3_cleanup() g_slist_free(_dnbd3_clients); close(_sock); + free(_images); dnbd3_delete_pid_file(); exit(EXIT_SUCCESS); } @@ -172,7 +174,7 @@ int main(int argc, char* argv[]) dnbd3_client->sock = fd; dnbd3_client->thread = &thread; - _dnbd3_clients = g_slist_append (_dnbd3_clients, dnbd3_client); + _dnbd3_clients = g_slist_append(_dnbd3_clients, dnbd3_client); pthread_create(&(thread), NULL, dnbd3_handle_query, (void *) (uintptr_t) dnbd3_client); } |