--- lbbs/src/menu_proc.c 2025/11/05 14:59:31 1.47 +++ lbbs/src/menu_proc.c 2025/11/11 00:28:05 1.50 @@ -6,6 +6,10 @@ * Copyright (C) 2004-2025 Leaflet */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "article_cache.h" #include "article_favor_display.h" #include "article_view_log.h" @@ -21,6 +25,7 @@ #include "user_info_update.h" #include "user_list_display.h" #include "user_priv.h" +#include #include #include #include @@ -141,11 +146,19 @@ int reload_bbs_conf(void *param) int shutdown_bbs(void *param) { - log_common("Notify main process to exit\n"); + char buf[2] = "N"; + + clearscr(); + get_data(1, 1, "真的要关闭系统吗[y/N]? ", buf, sizeof(buf), 1); - if (kill(getppid(), SIGTERM) < 0) + if (toupper(buf[0]) == 'Y') { - log_error("Send SIGTERM signal failed (%d)\n", errno); + log_common("Notify main process to exit by [%s]\n", BBS_username); + + if (kill(getppid(), SIGTERM) < 0) + { + log_error("Send SIGTERM signal failed (%d)\n", errno); + } } return REDRAW;