summaryrefslogtreecommitdiff
path: root/src/process/posix_spawn_file_actions_addclose.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-05-29 12:58:02 -0400
committerRich Felker <dalias@aerifal.cx>2011-05-29 12:58:02 -0400
commitf48832ee15027763826c8a7ff9eeed3fc06bb499 (patch)
treec22fc7561126476e81dfd1f985d4168726a8cfab /src/process/posix_spawn_file_actions_addclose.c
parentdd45edb5ff6198493edf1315d3e4e6ffc7b96447 (diff)
downloadmusl-f48832ee15027763826c8a7ff9eeed3fc06bb499.tar.gz
fix backwards posix_spawn file action order
Diffstat (limited to 'src/process/posix_spawn_file_actions_addclose.c')
-rw-r--r--src/process/posix_spawn_file_actions_addclose.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/process/posix_spawn_file_actions_addclose.c b/src/process/posix_spawn_file_actions_addclose.c
index 44c6314f..cdda5979 100644
--- a/src/process/posix_spawn_file_actions_addclose.c
+++ b/src/process/posix_spawn_file_actions_addclose.c
@@ -9,7 +9,8 @@ int posix_spawn_file_actions_addclose(posix_spawn_file_actions_t *fa, int fd)
if (!op) return ENOMEM;
op->cmd = FDOP_CLOSE;
op->fd = fd;
- op->next = fa->__actions;
+ if ((op->next = fa->__actions)) op->next->prev = op;
+ op->prev = 0;
fa->__actions = op;
return 0;
}