Skip to content

Commit 98eb2c1

Browse files
committed
shell: update shell_task_create() to take a shell argument
Problem: The shell_task_create() function takes a `struct shell_info *` argument, but the function may need access to the outer job shell object in the future, and struct shell_info has no pointer to this object. Update shell_task_create() to take a flux_shell_t argument.
1 parent 86e05aa commit 98eb2c1

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/shell/shell.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1668,7 +1668,7 @@ int main (int argc, char *argv[])
16681668
while (taskid != IDSET_INVALID_ID) {
16691669
struct shell_task *task;
16701670

1671-
if (!(task = shell_task_create (shell.info, i, taskid)))
1671+
if (!(task = shell_task_create (&shell, i, taskid)))
16721672
shell_die (1, "shell_task_create index=%d", i);
16731673

16741674
task->pre_exec_cb = shell_task_exec;

src/shell/task.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,11 @@ struct shell_task *shell_task_new (void)
9191
return NULL;
9292
}
9393

94-
struct shell_task *shell_task_create (struct shell_info *info,
94+
struct shell_task *shell_task_create (flux_shell_t *shell,
9595
int index,
9696
int taskid)
9797
{
98+
struct shell_info *info = shell->info;
9899
struct shell_task *task;
99100
const char *key;
100101
json_t *entry;

src/shell/task.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ struct shell_task {
5454

5555
void shell_task_destroy (struct shell_task *task);
5656

57-
struct shell_task *shell_task_create (struct shell_info *info,
57+
struct shell_task *shell_task_create (flux_shell_t *shell,
5858
int index,
5959
int taskid);
6060

0 commit comments

Comments
 (0)