dup2(st->out,1);
setsid();
- /* XXX We really should strdup() all of argv[] but because we'll just
- exit anyway if execvp() fails it doesn't seem worth bothering. */
execvp(st->path,(char *const*)st->argv);
perror("userv-entry: execvp()");
exit(1);
}
setnonblock(st->txfd);
setnonblock(st->rxfd);
+
+ add_hook(PHASE_CHILDPERSIST,childpersist_closefd_hook,&st->txfd);
+ add_hook(PHASE_CHILDPERSIST,childpersist_closefd_hook,&st->rxfd);
}
static void userv_kill_userv(struct userv *st)
item_t *item;
dict_t *dict;
- st=safe_malloc(sizeof(*st),"userv_apply");
+ NEW(st);
/* First parameter must be a dict */
item=list_elem(args,0);