}
int
-netifd_start_process(const char **argv, char **env, int dir_fd, struct netifd_process *proc)
+netifd_start_process(const char **argv, char **env, struct netifd_process *proc)
{
int pid;
env++;
}
}
- if (dir_fd >= 0)
- fchdir(dir_fd);
+ if (proc->dir_fd >= 0)
+ fchdir(proc->dir_fd);
execvp(argv[0], (char **) argv);
exit(127);
}
struct list_head list;
struct uloop_process uloop;
void (*cb)(struct netifd_process *, int ret);
+ int dir_fd;
};
-int netifd_start_process(const char **argv, char **env, int dir_fd, struct netifd_process *proc);
+int netifd_start_process(const char **argv, char **env, struct netifd_process *proc);
void netifd_kill_process(struct netifd_process *proc);
struct device;
argv[i++] = proto->iface->main_dev.dev->ifname;
argv[i] = NULL;
- ret = netifd_start_process(argv, NULL, proto_fd, proc);
+ ret = netifd_start_process(argv, NULL, proc);
free(config);
return ret;
if (!fill_string_list(tb[NOTIFY_ENV], env, ARRAY_SIZE(env)))
goto error;
- netifd_start_process((const char **) argv, (char **) env, proto_fd, &state->proto_task);
+ netifd_start_process((const char **) argv, (char **) env, &state->proto_task);
return 0;
state->proto.cb = proto_shell_handler;
state->setup_timeout.cb = proto_shell_setup_timeout_cb;
state->setup_task.cb = proto_shell_setup_cb;
+ state->setup_task.dir_fd = proto_fd;
state->teardown_task.cb = proto_shell_teardown_cb;
+ state->teardown_task.dir_fd = proto_fd;
state->proto_task.cb = proto_shell_task_cb;
+ state->proto_task.dir_fd = proto_fd;
state->handler = container_of(h, struct proto_shell_handler, proto);
return &state->proto;