--- lbbs/src/menu_proc.c 2025/05/04 14:54:55 1.9 +++ lbbs/src/menu_proc.c 2025/05/15 08:22:29 1.15 @@ -1,16 +1,15 @@ /*************************************************************************** menu_proc.c - description ------------------- - begin : Fri May 6 2005 - copyright : (C) 2005 by Leaflet - email : leaflet@leafok.com + 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 2 of the License, or * + * the Free Software Foundation; either version 3 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ @@ -21,6 +20,7 @@ #include "log.h" #include "io.h" #include "screen.h" +#include "menu.h" #include #include #include @@ -34,9 +34,11 @@ int exec_mbem(const char *str) void *hdll; int (*func)(); char *c, *s; - char buf[1024]; + char buf[FILE_PATH_LEN]; + + strncpy(buf, str, sizeof(buf) - 1); + buf[sizeof(buf) - 1] = '\0'; - strcpy(buf, str); s = strstr(buf, "@mod:"); if (s) { @@ -96,17 +98,29 @@ int copyright(const char *s) int reloadbbsmenu(const char *s) { - if (kill(getppid(), SIG_RELOAD_MENU) < 0) + clearscr(); + + if (kill(getppid(), SIGHUP) < 0) { - log_error("Send SIG_RELOAD_MENU signal failed (%d)\n", errno); + log_error("Send SIGHUP signal failed (%d)\n", errno); + + prints("发送指令失败\r\n"); } + else + { + prints("已发送指令\r\n"); + } + + press_any_key(); return REDRAW; } int shutdownbbs(const char *s) { - if (kill(0, SIGTERM) < 0) + log_std("Notify main process to exit\n"); + + if (kill(getppid(), SIGTERM) < 0) { log_error("Send SIGTERM signal failed (%d)\n", errno); }