Subversion Repositories wimsdev

Rev

Rev 15551 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 15551 Rev 15847
Line 45... Line 45...
45
int answerlen;
45
int answerlen;
46
int debugging;
46
int debugging;
47
char ipbuf[64];
47
char ipbuf[64];
48
char nodeipbuf[MAX_LINELEN+1];
48
char nodeipbuf[MAX_LINELEN+1];
49
char commbuf[BUFFERLEN+1];
49
char commbuf[BUFFERLEN+1];
50
#define textbuf (commbuf+sizeof(int))
-
 
51
char *textptr;
50
char *textptr;
52
 
51
 
53
int cwdtype;
52
int cwdtype;
54
 
53
 
55
/* check whether there is anything to execute */
54
/* check whether there is anything to execute */
Line 131... Line 130...
131
  struct stat st;
130
  struct stat st;
132
  uid_t myid;
131
  uid_t myid;
133
  int /*mfd,*/rsock,mincnt;
132
  int /*mfd,*/rsock,mincnt;
134
  char buf[MAX_LINELEN+1];
133
  char buf[MAX_LINELEN+1];
135
  forkcnt=0; exec_wait=1; mincnt=0;
134
  forkcnt=0; exec_wait=1; mincnt=0;
136
  classcaches=sheetcaches=0;
135
  classcaches=0;
137
  (void)freopen("/dev/null","r",stdin);
136
  (void)freopen("/dev/null","r",stdin);
138
  (void)freopen("../tmp/log/wimslogd.out","w",stdout);
137
  (void)freopen("../tmp/log/wimslogd.out","w",stdout);
139
  (void)freopen("../tmp/log/wimslogd.err","w",stderr);
138
  (void)freopen("../tmp/log/wimslogd.err","w",stderr);
140
  /*    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);
141
    write(mfd,buf,SHM_SIZE);
140
    write(mfd,buf,SHM_SIZE);
Line 186... Line 185...
186
    fd_set rset;
185
    fd_set rset;
187
    struct timeval tv;
186
    struct timeval tv;
188
    int t, selectcnt;
187
    int t, selectcnt;
189
 
188
 
190
    if(getpid()!=mypid) return 0;      /* leaked child */
189
    if(getpid()!=mypid) return 0;      /* leaked child */
-
 
190
    /* creer le fichier debugfile défini dans wimslogd.h pour voir apparaitre des debug*/
191
    if(stat(debugfile,&st)==0 && st.st_size<MAX_DEBUGLENGTH) debugging=1;
191
    if(stat(debugfile,&st)==0 && st.st_size<MAX_DEBUGLENGTH) debugging=1;
192
    else debugging=0;
192
    else debugging=0;
193
    wlogdaccessfile(loadavg,"r","/proc/loadavg");
193
    wlogdaccessfile(loadavg,"r","/proc/loadavg");
194
    for(selectcnt=0; selectcnt<100; selectcnt++) {
194
    for(selectcnt=0; selectcnt<100; selectcnt++) {
195
      tv.tv_sec=0; tv.tv_usec=50000; /* a pause every 50 ms. */
195
      tv.tv_sec=0; tv.tv_usec=50000; /* a pause every 50 ms. */