| 18 |
#include "bbs.h" |
#include "bbs.h" |
| 19 |
#include "common.h" |
#include "common.h" |
| 20 |
#include "io.h" |
#include "io.h" |
|
#include <unistd.h> |
|
| 21 |
#include <signal.h> |
#include <signal.h> |
| 22 |
#include <sys/param.h> |
#include <sys/param.h> |
| 23 |
#include <sys/types.h> |
#include <sys/types.h> |
| 24 |
#include <sys/stat.h> |
#include <sys/stat.h> |
| 25 |
|
#include <unistd.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 |
|
|
|
// for (i = 0; i < NOFILE; ++i) |
|
|
// close (i); |
|
|
chdir (app_home_dir); |
|
| 45 |
umask (0); |
umask (0); |
| 46 |
|
|
|
signal (SIGCHLD, SIG_IGN); |
|
|
|
|
| 47 |
return; |
return; |
| 48 |
} |
} |
| 49 |
|
|
| 65 |
while (fscanf (fin, "%s", c_name) != EOF) |
while (fscanf (fin, "%s", c_name) != EOF) |
| 66 |
{ |
{ |
| 67 |
if (c_name[0] == '#') |
if (c_name[0] == '#') |
| 68 |
{ |
{ |
| 69 |
fgets(temp, 256, fin); |
fgets (temp, 256, fin); |
| 70 |
continue; |
continue; |
| 71 |
} |
} |
| 72 |
fscanf (fin, "%*c"); |
fscanf (fin, "%*c"); |
| 73 |
if (strcmp (c_name, "bbs_id") == 0) |
if (strcmp (c_name, "bbs_id") == 0) |
| 74 |
{ |
{ |
| 102 |
{ |
{ |
| 103 |
int y = 0, m = 0, d = 0; |
int y = 0, m = 0, d = 0; |
| 104 |
fscanf (fin, "%d-%d-%d", &y, &m, &d); |
fscanf (fin, "%d-%d-%d", &y, &m, &d); |
| 105 |
sprintf (BBS_start_dt, "%4d年%2d月%2d日",y,m,d); |
sprintf (BBS_start_dt, "%4d年%2d月%2d日", y, m, d); |
| 106 |
} |
} |
| 107 |
if (strcmp (c_name, "db_host") == 0) |
if (strcmp (c_name, "db_host") == 0) |
| 108 |
{ |
{ |
| 123 |
} |
} |
| 124 |
|
|
| 125 |
fclose (fin); |
fclose (fin); |
| 126 |
|
|
| 127 |
return 0; |
return 0; |
| 128 |
} |
} |