diff --git a/__call.cpp b/__call.cpp index 622f6a0..fed1431 100644 --- a/__call.cpp +++ b/__call.cpp @@ -1,7 +1,6 @@ #include "__call.h" #include "Exception.h" #include "MString.h" -#include #include #include #include @@ -14,11 +13,11 @@ namespace jet { throw coreutils::Exception("call cannot have a container."); if(!variableDefined(coreutils::ZString("pgm"))) throw coreutils::Exception("pgm keyword must be specified."); - pipe[fd]; // TODO: Get these pipes to work with name and input keywords. - dup2(0); + pipe(fd); // TODO: Get these pipes to work with name and input keywords. + dup2(fd[0], 1); if(pid != fork()) { - argv[0] = variables["pgm"]; // TODO: Need to peel off the program name only and pass as argv[0]. - for(ix = 1; ix <= ARG_MAX; ++ix) { + argv[0] = variables["pgm"].c_str(); // TODO: Need to peel off the program name only and pass as argv[0]. + for(ix = 1; ix <= 50; ++ix) { coreutils::MString arg("arg"); arg << ix; if(variableDefined(arg)) @@ -30,7 +29,7 @@ namespace jet { execve(variables["pgm"].c_str(), argv, NULL); exit(-1); } - waitpid(&status); + waitpid(pid, &status,0); } diff --git a/__comment.cpp b/__comment.cpp index 685786b..6aad00c 100644 --- a/__comment.cpp +++ b/__comment.cpp @@ -1,4 +1,4 @@ -#include "__cpmment.h" +#include "__comment.h" #include "Exception.h" namespace jet { diff --git a/__read.cpp b/__read.cpp index 45d9abb..7771db2 100644 --- a/__read.cpp +++ b/__read.cpp @@ -1,5 +1,6 @@ #include "__read.h" #include "Exception.h" +#include #include #include @@ -10,7 +11,7 @@ namespace jet { throw coreutils::Exception("file keyword must be specified."); if(hasContainer) throw coreutils::Exception("read tag does not have a container."); - fd = open(variables["file"], O_RDONLY); + fd = open(variables["file"].c_str(), O_RDONLY); while(len = read(fd, &buffer, sizeof(buffer - 1))) { buffer[len] = 0; out << buffer; diff --git a/testjet b/testjet index 0542a46..d8ecdf1 100755 Binary files a/testjet and b/testjet differ