#include "list.h"
#include "user_list.h"
-static struct list_head user_list;
+INITIALIZED_LIST_HEAD(user_list);
/*
* Fill the list of users known to para_server.
void user_list_init(char *user_list_file)
{
struct user *u, *tmp;
- static int initialized;
- if (initialized) {
- list_for_each_entry_safe(u, tmp, &user_list, node) {
- list_del(&u->node);
- free(u->name);
- free_public_key(u->pubkey);
- free(u);
- }
- } else
- INIT_LIST_HEAD(&user_list);
- initialized = 1;
+ list_for_each_entry_safe(u, tmp, &user_list, node) {
+ list_del(&u->node);
+ free(u->name);
+ free_public_key(u->pubkey);
+ free(u);
+ }
populate(user_list_file);
}