Subversion Repositories wimsdev

Rev

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

Rev 11539 Rev 12011
Line 37... Line 37...
37
int multiexec=0, mxpid, notfirst;
37
int multiexec=0, mxpid, notfirst;
38
int pipe_in[2], pipe_out[2];
38
int pipe_in[2], pipe_out[2];
39
int debug=0;
39
int debug=0;
40
FILE *goin;
40
FILE *goin;
41
unsigned int seed; /* random seed value */
41
unsigned int seed; /* random seed value */
-
 
42
char *wseed;
42
char aboutbuf[aboutlen];
43
char aboutbuf[aboutlen];
43
/* this is only a default. It should usually be reset. */
44
/* this is only a default. It should usually be reset. */
44
char *tmpdir="/tmp";
45
char *tmpdir="/tmp";
45
char startstring[256], endstring[256];
46
char startstring[256], endstring[256];
46
char *obuf;
47
char *obuf;
Line 352... Line 353...
352
      fprintf(stderr,"%s: unable to create pipe.\n",progname);
353
      fprintf(stderr,"%s: unable to create pipe.\n",progname);
353
      exit(1);
354
      exit(1);
354
    }
355
    }
355
/*    i=fcntl(pipe_in[1],F_GETFL); if(i>=0) fcntl(pipe_in[1],F_SETFL,i|O_NONBLOCK);
356
/*    i=fcntl(pipe_in[1],F_GETFL); if(i>=0) fcntl(pipe_in[1],F_SETFL,i|O_NONBLOCK);
356
    i=fcntl(pipe_out[0],F_GETFL); if(i>=0) fcntl(pipe_out[0],F_SETFL,i|O_NONBLOCK);
357
    i=fcntl(pipe_out[0],F_GETFL); if(i>=0) fcntl(pipe_out[0],F_SETFL,i|O_NONBLOCK);
-
 
358
*/
357
*/    tmp_dir=getenv("tmp_dir"); if(tmp_dir==NULL || *tmp_dir==0) tmp_dir=tmpdir;
359
    tmp_dir=getenv("tmp_dir"); if(tmp_dir==NULL || *tmp_dir==0) tmp_dir=tmpdir;
358
    setenv("TMPDIR",tmp_dir,1);
360
    setenv("TMPDIR",tmp_dir,1);
-
 
361
    wseed=getenv("tmp_seed");
359
    mypid=getpid();
362
    mypid=getpid();
360
    gettimeofday(&t,NULL); seed=t.tv_usec*t.tv_sec+mypid;
363
    gettimeofday(&t,NULL); seed=t.tv_usec*t.tv_sec+mypid;
361
    srandom(seed);
364
    srandom(seed);
362
    for(i=0;i<4;i++) r[i]=random();
365
    for(i=0;i<4;i++) r[i]=random();
363
    snprintf(startstring,sizeof(startstring),
366
    snprintf(startstring,sizeof(startstring),