diff --git a/src/server/slavefuncs.c b/src/server/slavefuncs.c --- a/src/server/slavefuncs.c +++ b/src/server/slavefuncs.c @@ -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 */ }