]> git.tuebingen.mpg.de Git - adu.git/commitdiff
Simplify user table closing.
authorAndre Noll <maan@systemlinux.org>
Sat, 8 Nov 2008 17:58:01 +0000 (18:58 +0100)
committerAndre Noll <maan@systemlinux.org>
Sat, 8 Nov 2008 17:58:01 +0000 (18:58 +0100)
No need for an extra function for freeing the hash table.

adu.c
user.c
user.h

diff --git a/adu.c b/adu.c
index 657adb244dd138281f68d10c48487dcd4d567e86..a586ade942d892312a7b8b552614b2cfe3fbc88e 100644 (file)
--- a/adu.c
+++ b/adu.c
@@ -119,7 +119,6 @@ void close_all_tables(void)
 {
        close_dir_table();
        close_user_tables();
 {
        close_dir_table();
        close_user_tables();
-       free_hash_table();
 }
 
 static void signal_handler(int s)
 }
 
 static void signal_handler(int s)
diff --git a/user.c b/user.c
index 1f7e04a26f32cae30636c21b04a0092a14f2c3de..2b9fb202ed9f2dbc3cb584d45af659c9370c74b0 100644 (file)
--- a/user.c
+++ b/user.c
@@ -298,12 +298,6 @@ void create_hash_table(unsigned bits)
                sizeof(struct user_info));
 }
 
                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;
 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);
 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 0eba5bbdc610facd7ae85227cd09a17bc0ed0bc7..31f3a62155f7f6d0d1ab44ad088fed413ded3053 100644 (file)
--- 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 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);
 
 int for_each_admissible_user(int (*func)(struct user_info *, void *),
                void *data);