diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2021-02-18 14:55:10 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2021-02-18 14:55:10 -0500 |
commit | 8f039627ab777d2b08c0c46d5acacbe84817d20f (patch) | |
tree | 0ac67f93e41e29b2b5da836df2bdef54e037947f /process-posix.c | |
parent | e239b66691200163c1983b645c28b34825f32ea4 (diff) |
:build working (i think)
Diffstat (limited to 'process-posix.c')
-rw-r--r-- | process-posix.c | 4 |
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); |