Skip to content

Commit 1f0c181

Browse files
committed
posix_spawn: handle perm issues
1 parent 8b2edef commit 1f0c181

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
@@ -4754,6 +4754,11 @@ rb_posix_spawn(struct rb_execarg *eargp)
47544754
posix_spawn_file_actions_destroy(&file_actions);
47554755

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

0 commit comments

Comments
 (0)