Subversion Repositories wimsdev

Rev

Rev 15847 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 15847 Rev 17892
Line 127... Line 127...
127
int main(int argc, char *argv[])
127
int main(int argc, char *argv[])
128
{
128
{
129
  char *p;
129
  char *p;
130
  struct stat st;
130
  struct stat st;
131
  uid_t myid;
131
  uid_t myid;
132
  int /*mfd,*/rsock,mincnt;
132
  int /*mfd,mincnt,*/rsock;
133
  char buf[MAX_LINELEN+1];
133
  char buf[MAX_LINELEN+1];
134
  forkcnt=0; exec_wait=1; mincnt=0;
134
  forkcnt=0; exec_wait=1; /*mincnt=0;*/
135
  classcaches=0;
135
  classcaches=0;
136
  (void)freopen("/dev/null","r",stdin);
136
  (void)freopen("/dev/null","r",stdin);
137
  (void)freopen("../tmp/log/wimslogd.out","w",stdout);
137
  (void)freopen("../tmp/log/wimslogd.out","w",stdout);
138
  (void)freopen("../tmp/log/wimslogd.err","w",stderr);
138
  (void)freopen("../tmp/log/wimslogd.err","w",stderr);
139
  /*    mfd=shm_open(SHM_NAME,O_RDWR|O_CREAT|O_TRUNC,S_IRUSR|S_IWUSR);
139
  /*    mfd=shm_open(SHM_NAME,O_RDWR|O_CREAT|O_TRUNC,S_IRUSR|S_IWUSR);
Line 202... Line 202...
202
        answer(rsock);
202
        answer(rsock);
203
    }
203
    }
204
    forkman(1);
204
    forkman(1);
205
    getnow();
205
    getnow();
206
    if(thismin==lastmin) continue;
206
    if(thismin==lastmin) continue;
207
    mincnt++; /* if(mincnt>MAX_MIN) return 0; Refreshment. */
207
    /*mincnt++;  if(mincnt>MAX_MIN) return 0; Refreshment. */
208
    if(nowday!=startdate) return 0; /* Daily refreshment. */
208
    if(nowday!=startdate) return 0; /* Daily refreshment. */
209
    lastmin=thismin;
209
    lastmin=thismin;
210
    wlogdaccessfile(buf,"r",pidfile); strip_trailing_spaces(buf);
210
    wlogdaccessfile(buf,"r",pidfile); strip_trailing_spaces(buf);
211
    if(strcmp(buf,pidstr)!=0) {      /* wrong pid: abandon. */
211
    if(strcmp(buf,pidstr)!=0) {      /* wrong pid: abandon. */
212
      wait_children();
212
      wait_children();