Cleaned up read tag and call tag to compile.

This commit is contained in:
brad Arant committed 2024-07-08 18:50:46 -07:00
1 parent 666a12e16b
commit 49edce1f34
4 files changed
+8 -8

No files matched your search

+5 -6
View File
@@ -1,7 +1,6 @@
#include "__call.h"
#include "Exception.h"
#include "MString.h"
#include <limits.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
@@ -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);
}