add fast path for normal mutexes back to pthread_mutex_lock
[oweals/musl.git] / src / process / posix_spawn_file_actions_addclose.c
index 44c6314fcb69090da8b4dbec1336318dd692ff39..cdda5979916dd1437cc1e0249617847291fcd3e9 100644 (file)
@@ -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;
 }