Changeset - 00132229c637
[Not reviewed]
default
0 1 0
ethanzonca - 16 years ago 2009-07-31 19:25:24

Implemented ret in ssh_keygen(), started execio integration in exec_distren()
1 file changed with 24 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/server/slavefuncs.c
Show inline comments
 
@@ -51,7 +51,7 @@ int ssh_keygen(){
 
	char buf[10];
 
	struct execio *testrem;
 
	size_t readlen;
 
	fprintf(stderr, "Opening stream:\n", execio_open(&testrem, "ssh", cmd)); // This path will be absolute for testing, should be relative to install on production
 
	ret = execio_open(&testrem, "ssh", cmd); // This path will be absolute for testing, should be relative to install on production
 
	buf[9] = '\0'; // null-terminating the array...
 
	while(!execio_read(testrem, buf, 9, &readlen))
 
	    {
 
@@ -240,8 +240,30 @@ void conf_replace(char *username){
 
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!
 
  asprintf(frame,frame_str); // Converts the int frame to a string, so it can be in the cmd array. 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
 

	
 
  /* start execio code */
 
  	char *command = "ssh-keygen"; // @TODO: append .exe if win32?
 
  	int ret;
 
  	char *cmd[] = { command, "-q", "-f", SYSCONFDIR "/distren.id_rsa", "-N", "", (char *)NULL }; // TODO: Give me the correct args!
 

	
 
  	char buf[10];
 
  	struct execio *testrem;
 
  	size_t readlen;
 
  	fprintf(stderr, "Opening stream:\n", execio_open(&testrem, "ssh", cmd)); // This path will be absolute for testing, should be relative to install on production
 
  	buf[9] = '\0'; // null-terminating the array...
 
  	while(!execio_read(testrem, buf, 9, &readlen))
 
  	    {
 
  	      if(readlen > 9) {
 
  		fprintf(stderr, "Something is terribly wrong!\n");
 
  	      }
 
  	      buf[readlen] = '\0';
 
  	      fprintf(stderr, "read \"%s\"\n", buf);
 
  	    }
 
  	execio_close(testrem);
 
  /* end execio code */
 
}
0 comments (0 inline, 0 general)