| 19 |
#include "log.h" |
#include "log.h" |
| 20 |
#include "io.h" |
#include "io.h" |
| 21 |
#include "fork.h" |
#include "fork.h" |
| 22 |
|
#include "menu.h" |
| 23 |
#include <stdio.h> |
#include <stdio.h> |
| 24 |
#include <string.h> |
#include <string.h> |
| 25 |
|
#include <signal.h> |
| 26 |
#include <unistd.h> |
#include <unistd.h> |
| 27 |
#include <stdlib.h> |
#include <stdlib.h> |
| 28 |
#include <errno.h> |
#include <errno.h> |
| 68 |
return -4; |
return -4; |
| 69 |
} |
} |
| 70 |
|
|
| 71 |
|
SYS_child_process_count = 0; |
| 72 |
|
|
| 73 |
|
// Reset signal handler to default |
| 74 |
|
signal(SIGHUP, SIG_DFL); |
| 75 |
|
signal(SIGCHLD, SIG_DFL); |
| 76 |
|
signal(SIGTERM, SIG_DFL); |
| 77 |
|
|
| 78 |
bbs_main(); |
bbs_main(); |
| 79 |
|
|
| 80 |
// Child process exit |
// Child process exit |
| 89 |
close(STDIN_FILENO); |
close(STDIN_FILENO); |
| 90 |
close(STDOUT_FILENO); |
close(STDOUT_FILENO); |
| 91 |
|
|
| 92 |
log_std("Process exit normally\n"); |
// Unload menu |
| 93 |
|
unload_menu_shm(p_bbs_menu); |
| 94 |
|
free(p_bbs_menu); |
| 95 |
|
p_bbs_menu = NULL; |
| 96 |
|
|
| 97 |
|
log_std("Process exit normally\n"); |
| 98 |
log_end(); |
log_end(); |
| 99 |
|
|
| 100 |
|
_exit(0); |
| 101 |
|
|
| 102 |
return 0; |
return 0; |
| 103 |
} |
} |