fixed up call tag. Should be complete.

This commit is contained in:
Brad Arant committed 2024-11-18 12:44:41 -08:00
1 parent d3b8ab68e6
commit 5a7f7f2d18
5 files changed
+16 -14

No files matched your search

+8 -7
View File
@@ -33,7 +33,7 @@ namespace jet {
dup2(fdo[1], 1);
if(variableDefined("input")) {
resolveKeyword("input");
coreutils::ZString input(variables[variables["input"]]);
coreutils::ZString input(variables["input"]);
pipe(fdi);
if(fork() == 0) {
close(fdi[0]);
@@ -41,12 +41,12 @@ namespace jet {
close(fdi[1]);
exit(0);
}
close(fdi[0]);
close(fdi[1]);
dup2(fdi[0], 0);
}
rc = execve(variables["pgm"].c_str(), argv, NULL);
rc = execvpe(variables["pgm"].c_str(), argv, global.envp);
close(fdo[1]);
exit(rc);
exit(errno);
}
close(fdo[1]);
if(variableDefined("name")) {
@@ -63,9 +63,10 @@ namespace jet {
} else
out.read(fdo[0]);
waitpid(pid, &status, 0);
if(variableDefined("status"))
resolveKeyword("status");
global.variables[variables["status"]] = (status >> 8 & 255);
if(variableDefined("error")) {
resolveKeyword("error");
global.variables[variables["error"]] = (status >> 8 & 255);
}
}
}