summaryrefslogtreecommitdiff
path: root/process-posix.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-02-18 14:55:10 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-02-18 14:55:10 -0500
commit8f039627ab777d2b08c0c46d5acacbe84817d20f (patch)
tree0ac67f93e41e29b2b5da836df2bdef54e037947f /process-posix.c
parente239b66691200163c1983b645c28b34825f32ea4 (diff)
:build working (i think)
Diffstat (limited to 'process-posix.c')
-rw-r--r--process-posix.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/process-posix.c b/process-posix.c
index 6434f6e..8bfe036 100644
--- a/process-posix.c
+++ b/process-posix.c
@@ -9,7 +9,7 @@ struct Process {
char error[64];
};
-bool process_exec(Process *proc, char const *program, char **argv) {
+bool process_run(Process *proc, char const *command) {
memset(proc, 0, sizeof *proc);
bool success = false;
@@ -24,6 +24,8 @@ bool process_exec(Process *proc, char const *program, char **argv) {
dup2(pipefd[1], STDERR_FILENO);
close(pipefd[0]);
close(pipefd[1]);
+ char *program = "/bin/sh";
+ char *argv[] = {program, "-c", (char *)command, NULL};
if (execv(program, argv) == -1) {
dprintf(STDERR_FILENO, "%s: %s\n", program, strerror(errno));
exit(127);