Skip to content

Commit 5cf76df

Browse files
committed
posix_spawn: handle perm issues
1 parent 5969665 commit 5cf76df

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

process.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4756,6 +4756,11 @@ rb_posix_spawn(struct rb_execarg *eargp)
47564756
posix_spawn_file_actions_destroy(&file_actions);
47574757

47584758
if (err) {
4759+
// posix_spawn only returns fork/vfork/clone failures.
4760+
// If it failed but errno == 0, then it must be an "exec" failure.
4761+
if (errno == 0) {
4762+
eaccess(abspath, X_OK);
4763+
}
47594764
rb_sys_fail(abspath);
47604765
}
47614766

0 commit comments

Comments
 (0)