if (script_buftoenv(ctx, UNCONST(envbuf), len) == NULL)
return -1;
- pid = script_exec(ctx, argv, ctx->script_env);
+ pid = script_exec(argv, ctx->script_env);
if (pid == -1)
return -1;
/* Wait for the script to finish */
}
pid_t
-script_exec(const struct dhcpcd_ctx *ctx, char *const *argv, char *const *env)
+script_exec(char *const *argv, char *const *env)
{
pid_t pid = 0;
posix_spawnattr_t attr;
flags = POSIX_SPAWN_SETSIGMASK | POSIX_SPAWN_SETSIGDEF;
posix_spawnattr_setflags(&attr, flags);
sigemptyset(&defsigs);
+ posix_spawnattr_setsigmask(&attr, &defsigs);
for (i = 0; i < dhcpcd_signals_len; i++)
sigaddset(&defsigs, dhcpcd_signals[i]);
posix_spawnattr_setsigdefault(&attr, &defsigs);
- posix_spawnattr_setsigmask(&attr, &ctx->sigset);
#endif
errno = 0;
r = posix_spawn(&pid, argv[0], NULL, &attr, argv, env);
pid_t pid;
int status = 0;
- pid = script_exec(ctx, argv, ctx->script_env);
+ pid = script_exec(argv, ctx->script_env);
if (pid == -1)
logerr("%s: %s", __func__, argv[0]);
else if (pid != 0) {
__printflike(2, 3) int efprintf(FILE *, const char *, ...);
void if_printoptions(void);
char ** script_buftoenv(struct dhcpcd_ctx *, char *, size_t);
-pid_t script_exec(const struct dhcpcd_ctx *, char *const *, char *const *);
+pid_t script_exec(char *const *, char *const *);
int send_interface(struct fd_list *, const struct interface *, int);
int script_runreason(const struct interface *, const char *);
int script_runchroot(struct dhcpcd_ctx *, char *);