Skip to content

Commit

Permalink
MUSL fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mejedi committed Jun 10, 2019
1 parent 0dbfa4f commit 08e1e33
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/pipes.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ void pipe_foreach(
}

if (!strcmp(key, "stdout")) {
pipe.stdout = jsget_bool(request->json_root, value);
pipe.as_stdout = jsget_bool(request->json_root, value);
continue;
}

if (!strcmp(key, "stderr")) {
pipe.stderr = jsget_bool(request->json_root, value);
pipe.as_stderr = jsget_bool(request->json_root, value);
continue;
}

Expand All @@ -58,7 +58,7 @@ void pipe_foreach(
if (!pipe.file)
jserror(request->json_root, pipedef, "'file' missing");

if (!pipe.stdout && !pipe.stderr && !pipe.fifo)
if (!pipe.as_stdout && !pipe.as_stderr && !pipe.fifo)
jserror(request->json_root, pipedef,
"'stdout' or 'stderr' or 'fifo' is required");

Expand Down
4 changes: 2 additions & 2 deletions src/sandals.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ void map_user_and_group(const struct sandals_request *request);
struct sandals_pipe {
const char *file;
const char *fifo;
bool stdout;
bool stderr;
bool as_stdout;
bool as_stderr;
long limit;
};

Expand Down
6 changes: 3 additions & 3 deletions src/spawner.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ static void make_pipe(
"Creating fifo '%s': %s", pipe->fifo, strerror(errno));
pipe_fd[0] = open_checked(
pipe->fifo, O_RDONLY|O_NOCTTY|O_CLOEXEC|O_NONBLOCK, 0);
if (pipe->stdout || pipe->stderr)
if (pipe->as_stdout || pipe->as_stderr)
pipe_fd[1] = open_checked(
pipe->fifo, O_WRONLY|O_NOCTTY|O_CLOEXEC, 0);
} else {
Expand All @@ -79,8 +79,8 @@ static void make_pipe(
strerror(errno));
}

if (pipe->stdout) childstdout_fd = pipe_fd[1];
if (pipe->stderr) childstderr_fd = pipe_fd[1];
if (pipe->as_stdout) childstdout_fd = pipe_fd[1];
if (pipe->as_stderr) childstderr_fd = pipe_fd[1];
fd[index] = pipe_fd[0];
}

Expand Down
2 changes: 1 addition & 1 deletion src/supervisor.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ static void sink_init(

sink[index].pipe = *pipe;
if (!pipe->fifo)
sink[index].pipe.fifo = pipe->stdout ? "@stdout" : "@stderr";
sink[index].pipe.fifo = pipe->as_stdout ? "@stdout" : "@stderr";
sink[index].splice = 1;
sink[index].limit = pipe->limit;
sink[index].fd = open_checked(
Expand Down

0 comments on commit 08e1e33

Please sign in to comment.