overhaul posix_spawn to use CLONE_VM instead of vfork
[musl] / src / process / posix_spawn_file_actions_adddup2.c
index 26f2c5c..0367498 100644 (file)
@@ -3,13 +3,13 @@
 #include <errno.h>
 #include "fdop.h"
 
 #include <errno.h>
 #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;
 {
        struct fdop *op = malloc(sizeof *op);
        if (!op) return ENOMEM;
        op->cmd = FDOP_DUP2;
+       op->srcfd = srcfd;
        op->fd = fd;
        op->fd = fd;
-       op->newfd = newfd;
        if ((op->next = fa->__actions)) op->next->prev = op;
        op->prev = 0;
        fa->__actions = op;
        if ((op->next = fa->__actions)) op->next->prev = op;
        op->prev = 0;
        fa->__actions = op;