--- lbbs/src/article_favor.c 2025/10/24 02:07:01 1.5 +++ lbbs/src/article_favor.c 2025/11/04 13:49:50 1.7 @@ -1,18 +1,10 @@ -/*************************************************************************** - article_favor.c - description - ------------------- - Copyright : (C) 2004-2025 by Leaflet - Email : leaflet@leafok.com - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 3 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ +/* SPDX-License-Identifier: GPL-3.0-or-later */ +/* + * article_favor + * - data model and basic operations of user favorite articles + * + * Copyright (C) 2004-2025 by Leaflet + */ #include "article_favor.h" #include "common.h" @@ -508,19 +500,9 @@ int query_favor_articles(ARTICLE_FAVOR * return -3; } - // acquire lock of section - if (section_list_rd_lock(p_section) < 0) + if (get_section_info(p_section, p_snames[i], NULL, NULL) < 0) { - log_error("section_list_rd_lock(sid = %d) error\n", p_section->sid); - return -4; - } - - memcpy(p_snames[i], p_section->sname, sizeof(p_snames[i])); - - // release lock of section - if (section_list_rd_unlock(p_section) < 0) - { - log_error("section_list_rd_unlock(sid = %d) error\n", p_section->sid); + log_error("get_section_info(sid=%d) error\n", p_section->sid); return -4; } }