/[LeafOK_CVS]/lbbs/src/user_list.c
ViewVC logotype

Diff of /lbbs/src/user_list.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.2 by sysadm, Tue Oct 21 11:11:28 2025 UTC Revision 1.3 by sysadm, Tue Oct 21 12:10:20 2025 UTC
# Line 274  int user_list_pool_reload(void) Line 274  int user_list_pool_reload(void)
274  {  {
275      MYSQL *db = NULL;      MYSQL *db = NULL;
276      USER_LIST *p_tmp;      USER_LIST *p_tmp;
     int ret = 0;  
277    
278      if (p_user_list_pool == NULL)      if (p_user_list_pool == NULL)
279      {      {
# Line 289  int user_list_pool_reload(void) Line 288  int user_list_pool_reload(void)
288          return -1;          return -1;
289      }      }
290    
291      if (user_list_rw_lock() < 0)      if (user_list_load(db, p_user_list_pool->p_new) < 0)
292      {      {
293          log_error("user_list_rw_lock() error\n");          log_error("user_list_rw_lock() error\n");
294          return -2;          return -2;
295      }      }
296    
297      if (user_list_load(db, p_user_list_pool->p_new) < 0)      mysql_close(db);
298    
299        if (user_list_rw_lock() < 0)
300      {      {
301          log_error("user_list_rw_lock() error\n");          log_error("user_list_rw_lock() error\n");
302          ret = -3;          return -3;
         goto cleanup;  
303      }      }
304    
305      // Swap p_current and p_new      // Swap p_current and p_new
# Line 307  int user_list_pool_reload(void) Line 307  int user_list_pool_reload(void)
307      p_user_list_pool->p_current = p_user_list_pool->p_new;      p_user_list_pool->p_current = p_user_list_pool->p_new;
308      p_user_list_pool->p_new = p_tmp;      p_user_list_pool->p_new = p_tmp;
309    
 cleanup:  
310      if (user_list_rw_unlock() < 0)      if (user_list_rw_unlock() < 0)
311      {      {
312          log_error("user_list_rw_unlock() error\n");          log_error("user_list_rw_unlock() error\n");
313          ret = -2;          return -3;
314      }      }
315    
316      mysql_close(db);      return 0;
   
     return ret;  
317  }  }
318    
319  int user_list_try_rd_lock(int wait_sec)  int user_list_try_rd_lock(int wait_sec)


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1