| 15 |
* * |
* * |
| 16 |
***************************************************************************/ |
***************************************************************************/ |
| 17 |
|
|
| 18 |
|
#include "menu.h" |
| 19 |
#include <time.h> |
#include <time.h> |
| 20 |
|
#include <sys/types.h> |
| 21 |
|
#include <sys/wait.h> |
| 22 |
|
|
| 23 |
//Version information |
//Version information |
| 24 |
char app_version[256] = "LBBS-devel version 1.0"; |
char app_version[256] = "LBBS-devel version 1.0"; |
| 41 |
char DB_password[50]; |
char DB_password[50]; |
| 42 |
char DB_database[50]; |
char DB_database[50]; |
| 43 |
|
|
| 44 |
|
//Global declaration for system |
| 45 |
|
int SYS_exit; |
| 46 |
|
int SYS_child_process_count; |
| 47 |
|
|
| 48 |
//Common function |
//Common function |
| 49 |
const char * |
const char * |
| 50 |
str_space (char *string, int length) |
str_space (char *string, int length) |
| 100 |
|
|
| 101 |
return string; |
return string; |
| 102 |
} |
} |
| 103 |
|
|
| 104 |
|
void |
| 105 |
|
reload_bbs_menu (int i) |
| 106 |
|
{ |
| 107 |
|
if (reload_menu (&bbs_menu) < 0) |
| 108 |
|
log_error ("Reload menu failed\n"); |
| 109 |
|
else |
| 110 |
|
log_std ("Reload menu successfully\n"); |
| 111 |
|
|
| 112 |
|
} |
| 113 |
|
|
| 114 |
|
void |
| 115 |
|
system_exit (int i) |
| 116 |
|
{ |
| 117 |
|
SYS_exit = 1; |
| 118 |
|
} |
| 119 |
|
|
| 120 |
|
void |
| 121 |
|
child_exit (int i) |
| 122 |
|
{ |
| 123 |
|
int pid; |
| 124 |
|
|
| 125 |
|
pid = wait (0); |
| 126 |
|
|
| 127 |
|
if (pid > 0) |
| 128 |
|
{ |
| 129 |
|
SYS_child_process_count --; |
| 130 |
|
log_std ("Child process (%d) exited\n", pid); |
| 131 |
|
} |
| 132 |
|
} |