diff options
Diffstat (limited to 'src/process/posix_spawn_file_actions_addclose.c')
-rw-r--r-- | src/process/posix_spawn_file_actions_addclose.c | 3 |
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; } |