| 6 |
* Copyright (C) 2004-2025 Leaflet <leaflet@leafok.com> |
* Copyright (C) 2004-2025 Leaflet <leaflet@leafok.com> |
| 7 |
*/ |
*/ |
| 8 |
|
|
| 9 |
|
#ifdef HAVE_CONFIG_H |
| 10 |
|
#include "config.h" |
| 11 |
|
#endif |
| 12 |
|
|
| 13 |
#include "article_cache.h" |
#include "article_cache.h" |
| 14 |
#include "article_favor_display.h" |
#include "article_favor_display.h" |
| 15 |
#include "article_view_log.h" |
#include "article_view_log.h" |
| 16 |
#include "bbs.h" |
#include "bbs.h" |
| 17 |
#include "bbs_cmd.h" |
#include "bbs_cmd.h" |
| 18 |
|
#include "bbs_net.h" |
| 19 |
|
#include "chicken.h" |
| 20 |
#include "common.h" |
#include "common.h" |
| 21 |
#include "io.h" |
#include "io.h" |
| 22 |
#include "log.h" |
#include "log.h" |
| 27 |
#include "user_info_update.h" |
#include "user_info_update.h" |
| 28 |
#include "user_list_display.h" |
#include "user_list_display.h" |
| 29 |
#include "user_priv.h" |
#include "user_priv.h" |
| 30 |
|
#include <ctype.h> |
| 31 |
#include <dlfcn.h> |
#include <dlfcn.h> |
| 32 |
#include <errno.h> |
#include <errno.h> |
| 33 |
#include <signal.h> |
#include <signal.h> |
| 70 |
c++; |
c++; |
| 71 |
} |
} |
| 72 |
|
|
| 73 |
|
#ifdef LOAD_SO |
| 74 |
hdll = dlopen(s + 5, RTLD_LAZY); |
hdll = dlopen(s + 5, RTLD_LAZY); |
| 75 |
|
|
| 76 |
if (hdll) |
if (hdll) |
| 96 |
prints("失败原因:%s\r\n", dlerror()); |
prints("失败原因:%s\r\n", dlerror()); |
| 97 |
press_any_key(); |
press_any_key(); |
| 98 |
} |
} |
| 99 |
|
#else |
| 100 |
|
(void)hdll; |
| 101 |
|
(void)func; |
| 102 |
|
|
| 103 |
|
if (strcasecmp(c, "bbs_net") == 0) |
| 104 |
|
{ |
| 105 |
|
bbs_net(); |
| 106 |
|
} |
| 107 |
|
else if (strcasecmp(c, "chicken_main") == 0) |
| 108 |
|
{ |
| 109 |
|
chicken_main(); |
| 110 |
|
} |
| 111 |
|
else |
| 112 |
|
{ |
| 113 |
|
clearscr(); |
| 114 |
|
prints("未知入口 [%s] !!\r\n", c); |
| 115 |
|
press_any_key(); |
| 116 |
|
} |
| 117 |
|
#endif |
| 118 |
} |
} |
| 119 |
|
|
| 120 |
return REDRAW; |
return REDRAW; |
| 168 |
|
|
| 169 |
int shutdown_bbs(void *param) |
int shutdown_bbs(void *param) |
| 170 |
{ |
{ |
| 171 |
log_common("Notify main process to exit\n"); |
char buf[2] = "N"; |
| 172 |
|
|
| 173 |
if (kill(getppid(), SIGTERM) < 0) |
clearscr(); |
| 174 |
|
get_data(1, 1, "真的要关闭系统吗[y/N]? ", buf, sizeof(buf), 1); |
| 175 |
|
|
| 176 |
|
if (toupper(buf[0]) == 'Y') |
| 177 |
{ |
{ |
| 178 |
log_error("Send SIGTERM signal failed (%d)\n", errno); |
log_common("Notify main process to exit by [%s]\n", BBS_username); |
| 179 |
|
|
| 180 |
|
if (kill(getppid(), SIGTERM) < 0) |
| 181 |
|
{ |
| 182 |
|
log_error("Send SIGTERM signal failed (%d)\n", errno); |
| 183 |
|
} |
| 184 |
} |
} |
| 185 |
|
|
| 186 |
return REDRAW; |
return REDRAW; |
| 402 |
} |
} |
| 403 |
|
|
| 404 |
return REDRAW; |
return REDRAW; |
| 405 |
|
} |
| 406 |
|
|
| 407 |
|
int edit_sign(void *param) |
| 408 |
|
{ |
| 409 |
|
if (user_sign_edit(BBS_priv.uid) < 0) |
| 410 |
|
{ |
| 411 |
|
log_error("user_sign_edit(%d) error\n", BBS_priv.uid); |
| 412 |
|
} |
| 413 |
|
|
| 414 |
|
return REDRAW; |
| 415 |
} |
} |