projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix backwards posix_spawn file action order
[musl]
/
src
/
process
/
posix_spawn.c
diff --git
a/src/process/posix_spawn.c
b/src/process/posix_spawn.c
index
59f4a8b
..
b1a9fbd
100644
(file)
--- a/
src/process/posix_spawn.c
+++ b/
src/process/posix_spawn.c
@@
-51,10
+51,11
@@
int __posix_spawnx(pid_t *res, const char *path,
__syscall(SYS_setuid, __syscall(SYS_getuid)) ))
_exit(127);
__syscall(SYS_setuid, __syscall(SYS_getuid)) ))
_exit(127);
- if (fa) {
+ if (fa
&& fa->__actions
) {
struct fdop *op;
int ret, fd;
struct fdop *op;
int ret, fd;
- for (op = fa->__actions; op; op = op->next) {
+ for (op = fa->__actions; op->next; op = op->next);
+ for (; op; op = op->prev) {
switch(op->cmd) {
case FDOP_CLOSE:
ret = __syscall(SYS_close, op->fd);
switch(op->cmd) {
case FDOP_CLOSE:
ret = __syscall(SYS_close, op->fd);