From: Andre Noll Date: Sat, 8 Nov 2008 17:58:01 +0000 (+0100) Subject: Simplify user table closing. X-Git-Tag: v0.0.5~1^2~23 X-Git-Url: http://git.tuebingen.mpg.de/?p=adu.git;a=commitdiff_plain;h=d2766d0ff7604df7308a10e4fa4272f4d8a06e87 Simplify user table closing. No need for an extra function for freeing the hash table. --- diff --git a/adu.c b/adu.c index 657adb2..a586ade 100644 --- a/adu.c +++ b/adu.c @@ -119,7 +119,6 @@ void close_all_tables(void) { close_dir_table(); close_user_tables(); - free_hash_table(); } static void signal_handler(int s) diff --git a/user.c b/user.c index 1f7e04a..2b9fb20 100644 --- a/user.c +++ b/user.c @@ -298,12 +298,6 @@ void create_hash_table(unsigned bits) sizeof(struct user_info)); } -void free_hash_table(void) -{ - free(uid_hash_table); - uid_hash_table = NULL; -} - static int close_user_table(struct user_info *ui, __a_unused void *data) { int ret; @@ -328,6 +322,8 @@ static int close_user_table(struct user_info *ui, __a_unused void *data) void close_user_tables(void) { for_each_admissible_user(close_user_table, NULL); + free(uid_hash_table); + uid_hash_table = NULL; } /* diff --git a/user.h b/user.h index 0eba5bb..31f3a62 100644 --- a/user.h +++ b/user.h @@ -45,7 +45,6 @@ int write_uid_file(void); void create_hash_table(unsigned bits); void sort_hash_table(int (*comp)(const void *, const void *)); -void free_hash_table(void); int for_each_admissible_user(int (*func)(struct user_info *, void *), void *data);