| 24 |
#include "io.h" |
#include "io.h" |
| 25 |
#include "fork.h" |
#include "fork.h" |
| 26 |
#include "menu.h" |
#include "menu.h" |
| 27 |
|
#include "file_loader.h" |
| 28 |
#include <errno.h> |
#include <errno.h> |
| 29 |
#include <fcntl.h> |
#include <fcntl.h> |
| 30 |
#include <string.h> |
#include <string.h> |
| 129 |
sd_notify(0, "STOPPING=1"); |
sd_notify(0, "STOPPING=1"); |
| 130 |
sd_notify_stopping = 1; |
sd_notify_stopping = 1; |
| 131 |
} |
} |
| 132 |
|
|
| 133 |
while ((SYS_child_exit || SYS_server_exit) && SYS_child_process_count > 0) |
while ((SYS_child_exit || SYS_server_exit) && SYS_child_process_count > 0) |
| 134 |
{ |
{ |
| 135 |
SYS_child_exit = 0; |
SYS_child_exit = 0; |
| 168 |
if (SYS_menu_reload && !SYS_server_exit) |
if (SYS_menu_reload && !SYS_server_exit) |
| 169 |
{ |
{ |
| 170 |
SYS_menu_reload = 0; |
SYS_menu_reload = 0; |
| 171 |
|
sd_notify(0, "RELOADING=1"); |
| 172 |
|
|
| 173 |
p_bbs_menu_new = calloc(1, sizeof(MENU_SET)); |
p_bbs_menu_new = calloc(1, sizeof(MENU_SET)); |
| 174 |
if (p_bbs_menu_new == NULL) |
if (p_bbs_menu_new == NULL) |
| 194 |
|
|
| 195 |
log_std("Reload menu successfully\n"); |
log_std("Reload menu successfully\n"); |
| 196 |
} |
} |
| 197 |
|
|
| 198 |
|
sd_notify(0, "READY=1"); |
| 199 |
|
} |
| 200 |
|
|
| 201 |
|
if (SYS_data_file_reload && !SYS_server_exit) |
| 202 |
|
{ |
| 203 |
|
SYS_data_file_reload = 0; |
| 204 |
|
sd_notify(0, "RELOADING=1"); |
| 205 |
|
|
| 206 |
|
for (int i = 0; i < data_files_load_startup_count; i++) |
| 207 |
|
{ |
| 208 |
|
if (load_file_shm(data_files_load_startup[i]) < 0) |
| 209 |
|
{ |
| 210 |
|
log_error("load_file_mmap(%s) error\n", data_files_load_startup[i]); |
| 211 |
|
} |
| 212 |
|
} |
| 213 |
|
|
| 214 |
|
log_std("Reload data files successfully\n"); |
| 215 |
|
sd_notify(0, "READY=1"); |
| 216 |
} |
} |
| 217 |
|
|
| 218 |
nfds = epoll_wait(epollfd, events, MAX_EVENTS, 100); // 0.1 second |
nfds = epoll_wait(epollfd, events, MAX_EVENTS, 100); // 0.1 second |