X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fprocess%2Fposix_spawn_file_actions_adddup2.c;h=0367498fd4f36ca9fe5d0ae12ec65fc15936bc5b;hb=b6218764ebca59ff5dae0e87b696188c8de0119e;hp=9209ee7c2e84fa78460db6a9cc7cd541c43ab3bf;hpb=a0ae0b09368e6dbfa82860187dcd6fdf86d86fee;p=musl diff --git a/src/process/posix_spawn_file_actions_adddup2.c b/src/process/posix_spawn_file_actions_adddup2.c index 9209ee7c..0367498f 100644 --- a/src/process/posix_spawn_file_actions_adddup2.c +++ b/src/process/posix_spawn_file_actions_adddup2.c @@ -3,14 +3,15 @@ #include #include "fdop.h" -int posix_spawn_file_actions_adddup2(posix_spawn_file_actions_t *fa, int fd, int newfd) +int posix_spawn_file_actions_adddup2(posix_spawn_file_actions_t *fa, int srcfd, int fd) { struct fdop *op = malloc(sizeof *op); if (!op) return ENOMEM; op->cmd = FDOP_DUP2; + op->srcfd = srcfd; op->fd = fd; - op->newfd = newfd; - op->next = fa->__actions; + if ((op->next = fa->__actions)) op->next->prev = op; + op->prev = 0; fa->__actions = op; return 0; }