| 17 |
|
|
| 18 |
#include "bbs.h" |
#include "bbs.h" |
| 19 |
#include "common.h" |
#include "common.h" |
| 20 |
|
#include "io.h" |
| 21 |
|
#include <unistd.h> |
| 22 |
|
#include <signal.h> |
| 23 |
|
#include <sys/param.h> |
| 24 |
|
#include <sys/types.h> |
| 25 |
|
#include <sys/stat.h> |
| 26 |
|
|
| 27 |
void |
void |
| 28 |
init_daemon (void) |
init_daemon (void) |
| 42 |
else if (pid < 0) |
else if (pid < 0) |
| 43 |
exit (1); |
exit (1); |
| 44 |
|
|
| 45 |
for (i = 0; i < NOFILE; ++i) |
// for (i = 0; i < NOFILE; ++i) |
| 46 |
close (i); |
// close (i); |
| 47 |
chdir (app_home_dir); |
chdir (app_home_dir); |
| 48 |
umask (0); |
umask (0); |
| 49 |
|
|
| 63 |
|
|
| 64 |
if ((fin = fopen (conf_file, "r")) == NULL) |
if ((fin = fopen (conf_file, "r")) == NULL) |
| 65 |
{ |
{ |
| 66 |
log_error ("Open bbsd.conf failed"); |
log_error ("Open %s failed", conf_file); |
| 67 |
return -1; |
return -1; |
| 68 |
} |
} |
| 69 |
|
|