Changeset - 384331f8928e
[Not reviewed]
default
0 3 0
ethanzonca@localhost.localdomain - 16 years ago 2009-11-24 00:27:01
ethanzonca@localhost.localdomain
Added return to blender_exec
3 files changed with 7 insertions and 9 deletions:
0 comments (0 inline, 0 general)
src/server/slave.c
Show inline comments
 
@@ -168,13 +168,16 @@ int main(int argc, char *argv[])
 
        outputExt = myjob->output_format; /* @TODO: FIXME! <-- I WILL! */
 
        /* Prepares the path to the jobfile */
 
        _distren_asprintf(&pathtoOutput, "%s/job%d/output/job%d-frame%d.%s", datadir, jobnum, jobnum, framenum, outputExt );
 
        free(outputExt);
 

	
 
        /* Execute blender */
 
        exec_blender(pathtoJobfile, pathtoOutput, framenum); /* @TODO: This warning should be fixed :D */
 
        if(exec_blender(pathtoJobfile, pathtoOutput, framenum)){ /* @TODO: This warning should be fixed :D */
 
            fprintf(stderr,"Error running Blender. Check your installation and/or your PATH.");
 
            return 1;
 
        }
 
        free(pathtoJobfile);
 

	
 
        /* When blender is finished, run this... */
 
        fprintf(stderr, "Finished frame %d in job %d, uploading...", framenum, jobnum);
 
        if( !curlpost(pathtoOutput, urltoOutput)){ // Uploads output
 
          fprintf(stderr,"Upload successful, removing old output...\n");
src/server/slavefuncs.c
Show inline comments
 
@@ -210,13 +210,13 @@ return 1; // Success
 
}
 

	
 

	
 
/* Executors */
 

	
 
/** Executor function for Blender operations */
 
void exec_blender(char *input, char *output, int frame)
 
int exec_blender(char *input, char *output, int frame)
 
{
 
  fprintf(stderr,"Preparing to execute...\n");
 
  int ret;
 
  char *frame_str;
 

	
 
  char *command = "blender"; // @TODO: append .exe if win32? Do we expect this to be in the PATH?
 
@@ -237,18 +237,13 @@ void exec_blender(char *input, char *out
 
       }
 
       buf[readlen] = '\0';
 
       fprintf(stderr, "read \"%s\"\n", buf);
 
    }
 
  execio_close(testrem);
 

	
 
  if(ret == 1){
 
    fprintf(stderr,"Error starting Blender. Check your path and installation.\n");
 
  }
 
  else{
 
    fprintf(stderr,"Execution of Blender was successful.\n");
 
  }
 
  return ret;
 
}
 

	
 
void xmlinit()
 
{
 
  xmlInitParser();
 
  xmlXPathInit();
src/server/slavefuncs.h
Show inline comments
 
@@ -33,11 +33,11 @@ size_t curl_writetodisk(void *ptr, size_
 
int curlget(char *url, char *out);
 
int curlpost(char *filename, char *url);
 
int ssh_keygen();
 
int register_user(char *username, char *email);
 
int login_user(char *username);
 
int conf_replace(char *username);
 
void exec_blender(char *input, char *output, int frame);
 
int exec_blender(char *input, char *output, int frame);
 
void xmlinit();
 
void xmlcleanup();
 

	
 
#endif
0 comments (0 inline, 0 general)