Skip to content

Commit

Permalink
shell: output: rename struct members to avoid reserved word
Browse files Browse the repository at this point in the history
  • Loading branch information
grondo committed Jan 5, 2025
1 parent 9274ac1 commit 5075a4c
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 22 deletions.
14 changes: 7 additions & 7 deletions src/shell/output/conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,17 +139,17 @@ struct output_config *output_config_create (flux_shell_t *shell)
if (!(conf = calloc (1, sizeof (*conf))))
return NULL;

conf->stdout.type = FLUX_OUTPUT_TYPE_KVS;
conf->stdout.mode = "truncate";
conf->stdout.buffer_type = "line";
if (output_stream_getopts (shell, "stdout", &conf->stdout) < 0)
conf->out.type = FLUX_OUTPUT_TYPE_KVS;
conf->out.mode = "truncate";
conf->out.buffer_type = "line";
if (output_stream_getopts (shell, "stdout", &conf->out) < 0)
goto error;

/* stderr defaults except for buffer_type inherit from stdout:
*/
conf->stderr = conf->stdout;
conf->stderr.buffer_type = "none";
if (output_stream_getopts (shell, "stderr", &conf->stderr) < 0)
conf->err = conf->out;
conf->err.buffer_type = "none";
if (output_stream_getopts (shell, "stderr", &conf->err) < 0)
goto error;

return conf;
Expand Down
4 changes: 2 additions & 2 deletions src/shell/output/conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ struct output_stream {
};

struct output_config {
struct output_stream stdout;
struct output_stream stderr;
struct output_stream out;
struct output_stream err;
};

struct output_config *output_config_create (flux_shell_t *shell);
Expand Down
2 changes: 1 addition & 1 deletion src/shell/output/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ static int log_output (flux_plugin_t *p,

void shell_output_log_init (flux_plugin_t *p, struct shell_output *out)
{
if (out->conf->stderr.type == FLUX_OUTPUT_TYPE_FILE) {
if (out->conf->err.type == FLUX_OUTPUT_TYPE_FILE) {
if (flux_plugin_add_handler (p, "shell.log", log_output, out) < 0)
shell_log_errno ("failed to add shell.log handler");
flux_shell_log_setlevel (FLUX_SHELL_QUIET, "eventlog");
Expand Down
4 changes: 2 additions & 2 deletions src/shell/output/output.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ static int output_redirect_stream (struct shell_output *out,

static int shell_output_redirect (struct shell_output *out)
{
if (output_redirect_stream (out, "stdout", &out->conf->stdout) < 0
|| output_redirect_stream (out, "stderr", &out->conf->stderr) < 0)
if (output_redirect_stream (out, "stdout", &out->conf->out) < 0
|| output_redirect_stream (out, "stderr", &out->conf->err) < 0)
return -1;
return 0;
}
Expand Down
20 changes: 10 additions & 10 deletions src/shell/output/task.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,16 +189,16 @@ static struct task_output *task_output_create (struct shell_output *out,
/* rank 0: if stdout/err are files then task writes to file,
* otherwise KVS.
*/
if (out->conf->stdout.type == FLUX_OUTPUT_TYPE_FILE) {
if (!(to->stdout = task_open_file (out, task, &out->conf->stdout)))
if (out->conf->out.type == FLUX_OUTPUT_TYPE_FILE) {
if (!(to->stdout = task_open_file (out, task, &out->conf->out)))
goto error;
to->stdout_f = task_output_write_file;
}
else
to->stdout_f = task_output_write_kvs;

if (out->conf->stderr.type == FLUX_OUTPUT_TYPE_FILE) {
if (!(to->stderr = task_open_file (out, task, &out->conf->stderr)))
if (out->conf->err.type == FLUX_OUTPUT_TYPE_FILE) {
if (!(to->stderr = task_open_file (out, task, &out->conf->err)))
goto error;
to->stderr_f = task_output_write_file;
}
Expand All @@ -208,16 +208,16 @@ static struct task_output *task_output_create (struct shell_output *out,
else {
/* Other shell ranks: client writer unless per-shell output
*/
if (out->conf->stdout.per_shell) {
if (!(to->stdout = task_open_file (out, task, &out->conf->stdout)))
if (out->conf->out.per_shell) {
if (!(to->stdout = task_open_file (out, task, &out->conf->out)))
goto error;
to->stdout_f = task_output_write_file;
}
else
to->stdout_f = task_output_write_client;

if (out->conf->stderr.per_shell) {
if (!(to->stderr = task_open_file (out, task, &out->conf->stderr)))
if (out->conf->err.per_shell) {
if (!(to->stderr = task_open_file (out, task, &out->conf->err)))
goto error;
to->stderr_f = task_output_write_file;
}
Expand Down Expand Up @@ -366,8 +366,8 @@ struct task_output_list *task_output_list_create (struct shell_output *out)
* and add task output object to task outputs list
*/
if (!(to = task_output_create (out, task))
|| task_output_setup_stream (to, "stdout", &out->conf->stdout) < 0
|| task_output_setup_stream (to, "stderr", &out->conf->stderr) < 0
|| task_output_setup_stream (to, "stdout", &out->conf->out) < 0
|| task_output_setup_stream (to, "stderr", &out->conf->err) < 0
|| !zlistx_add_end (l->task_outputs, to))
goto error;
task = flux_shell_task_next (out->shell);
Expand Down

0 comments on commit 5075a4c

Please sign in to comment.