/[LeafOK_CVS]/lbbs/src/init.c
ViewVC logotype

Diff of /lbbs/src/init.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.7 by sysadm, Thu Mar 17 10:48:46 2005 UTC Revision 1.10 by sysadm, Sat May 7 12:08:28 2005 UTC
# Line 18  Line 18 
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)
# Line 42  init_daemon (void) Line 42  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    
# Line 70  load_conf (const char *conf_file) Line 65  load_conf (const char *conf_file)
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          {          {
# Line 107  load_conf (const char *conf_file) Line 102  load_conf (const char *conf_file)
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          {          {
# Line 128  load_conf (const char *conf_file) Line 123  load_conf (const char *conf_file)
123      }      }
124    
125    fclose (fin);    fclose (fin);
126      
127    return 0;    return 0;
128  }  }


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1