diff --git a/src/server/distrend.c b/src/server/distrend.c --- a/src/server/distrend.c +++ b/src/server/distrend.c @@ -27,6 +27,9 @@ */ #include +#include "execio.h" +#include "options.h" + #define max 100 // maximum number of stored jobs in memory, per job type (lux/blend). Eventually we can dump this data to disk, or atleast the remainder not in memory... int jobnum = 0; @@ -94,7 +97,30 @@ void queue(int type, char *name, char *s jobnum++; } - +// Mostly kinda copied from old code, but I understand it a tad better now :) +char buf[10]; +struct execio *testrem; +char *execargv[] = + { +"ssh", +"ethanzonca@protofusion.org", +"sh", +"-c", +"\"echo hello from ${HOSTNAME}\"", +(char *)NULL + }; +size_t readlen; +fprintf(stderr, "execio_open:", execio_open(&testrem, "ssh", execargv)); +buf[9] = '\0'; // null-terminating the array... +while(!execio_read(testrem, buf, 9, &readlen)) // What's with the readlen stuff? + { + if(readlen > 9) { + fprintf(stderr, "Something is terribly wrong!\n"); + } + buf[readlen] = '\0'; // Null-terminating the end of it again based on how large the data is? + fprintf(stderr, "read \"&s\"\n", buf); + } +execio_close(testrem); ///////////////////////// SLAVE ///////////////////////////////