aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2024-02-06 10:15:43 -0500
committerJoseph Hunkeler <jhunkeler@gmail.com>2024-02-06 10:15:43 -0500
commitfe8eb2e7772087d16dfc054434f84c0cc92fdd23 (patch)
treee3200b567007ddef86e49a744b70f36b0dd93819
parent906b120e249c7d73fcd03477bafbdd80ce61b7eb (diff)
downloadstasis-fe8eb2e7772087d16dfc054434f84c0cc92fdd23.tar.gz
Refactor std output stream to use f_std{out,err}
-rw-r--r--src/system.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/system.c b/src/system.c
index a8b966f..ea34717 100644
--- a/src/system.c
+++ b/src/system.c
@@ -54,7 +54,7 @@ int shell(struct Process *proc, char *args) {
remove(t_name);
}
- if (proc != NULL && strlen(proc->stdout)) {
+ if (proc != NULL && strlen(proc->f_stdout)) {
if (fp_out != NULL) {
fflush(fp_out);
fclose(fp_out);
@@ -62,7 +62,7 @@ int shell(struct Process *proc, char *args) {
fflush(stdout);
fclose(stdout);
}
- if (proc != NULL && strlen(proc->stderr)) {
+ if (proc != NULL && strlen(proc->f_stderr)) {
if (fp_err) {
fflush(fp_err);
fclose(fp_err);
@@ -106,8 +106,8 @@ int shell_safe(struct Process *proc, char *args) {
}
result = shell(proc, args);
- if (strlen(proc->stdout)) {
- fp = fopen(proc->stdout, "r");
+ if (strlen(proc->f_stdout)) {
+ fp = fopen(proc->f_stdout, "r");
if (fp) {
while (fgets(buf, sizeof(buf) - 1, fp)) {
fprintf(stdout, "%s", buf);
@@ -117,8 +117,8 @@ int shell_safe(struct Process *proc, char *args) {
fp = NULL;
}
}
- if (strlen(proc->stderr)) {
- fp = fopen(proc->stderr, "r");
+ if (strlen(proc->f_stderr)) {
+ fp = fopen(proc->f_stderr, "r");
if (fp) {
while (fgets(buf, sizeof(buf) - 1, fp)) {
fprintf(stderr, "%s", buf);