From 08e1e33ad48dd7ee24cf68c2d2a8e735b22bbb1d Mon Sep 17 00:00:00 2001 From: Nick Zavaritsky Date: Mon, 10 Jun 2019 12:49:22 +0000 Subject: [PATCH] MUSL fixes --- src/pipes.c | 6 +++--- src/sandals.h | 4 ++-- src/spawner.c | 6 +++--- src/supervisor.c | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/pipes.c b/src/pipes.c index b8f9326..e0015df 100644 --- a/src/pipes.c +++ b/src/pipes.c @@ -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; } @@ -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"); diff --git a/src/sandals.h b/src/sandals.h index da1b70c..d898538 100644 --- a/src/sandals.h +++ b/src/sandals.h @@ -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; }; diff --git a/src/spawner.c b/src/spawner.c index a821df5..beadf9e 100644 --- a/src/spawner.c +++ b/src/spawner.c @@ -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 { @@ -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]; } diff --git a/src/supervisor.c b/src/supervisor.c index 8e2679c..f50872b 100644 --- a/src/supervisor.c +++ b/src/supervisor.c @@ -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(