Changeset - cc5739363b02
[Not reviewed]
default
0 2 0
ethanzonca - 16 years ago 2009-07-30 15:11:31

Removed key from conf, as it will be stored as a file, etc.
2 files changed with 1 insertions and 2 deletions:
0 comments (0 inline, 0 general)
etc/distrenslave.conf
Show inline comments
 
slave
 
{
 
  username = "!username"
 
  key = "!key"
 
}
 

	
 
include("distrencommon.conf")
src/server/slavefuncs.c
Show inline comments
 
@@ -179,42 +179,42 @@ void conf_replace(char *username){
 
  char *buff_ptr, *find_ptr;
 
  FILE *fp1, *fp2;
 
  size_t find_len = strlen(text2find);
 
  fp1 = fopen(fileOrig,"r");
 
  fp2 = fopen(fileRepl,"w");
 
  if (fp1 !=NULL || fp2 !=NULL){
 
    while(fgets(buffer,maxlinelen+2,fp1))
 
      {
 
          buff_ptr = buffer;
 
          while ((find_ptr = strstr(buff_ptr,text2find)))
 
          {
 
          while(buff_ptr < find_ptr)
 
          	fputc((int)*buff_ptr++,fp2);
 
          fputs(text2repl,fp2);
 
          buff_ptr += find_len;
 
          }
 
          fputs(buff_ptr,fp2);
 
      }
 
  }
 
  else{
 
	  fprintf(stderr, "distrenslave.conf doesn't exist!");
 
  }
 
  fclose(fp2);
 
  fclose(fp1);
 
  fprintf(stderr,"conf replacements likely worked")
 
  fprintf(stderr,"conf replacements likely worked");
 
}
 

	
 

	
 
/* Executors */
 

	
 
/*
 
  It seems that the client will need to know the job number. fixme.
 
*/
 

	
 
void exec_blender(struct blendjob* blendjob, char *input, char *output, int frame)
 
{
 
  char *frame_str;
 
  asprintf(frame,frame_str); // GNU/*nix compatible only, fix before releasing win32, although dll for windows for asprintf exists!
 
  int ret;
 
  char *cmd[] = { "blender", "-b", "-o", output, input, "-f", frame_str, (char *)0 };
 
  ret = execv("/usr/bin/blender", cmd); // This path will be absolute for testing, should be relative to install on production
 
}
0 comments (0 inline, 0 general)