Skip to content

Commit

Permalink
libast: fix exec fail on interactive (Solaris patch 315-26773587)
Browse files Browse the repository at this point in the history
This upstreams a Solaris patch:
https://github.com/oracle/solaris-userland/blob/master/components/ksh93/patches/315-26773587.patch
which ostensibly fixes this bug filed in Oracle's closed system:
26773587 interactive ksh exec failure in while read loop

src/lib/libast/comp/spawnveg.c:
- If posix_spawn(3) fails with an error other than EPERM, retry,
  but without attributes.
  • Loading branch information
McDutchie committed Jan 9, 2021
1 parent 4e67234 commit 7d2bb8f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/libast/comp/spawnveg.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ spawnveg(const char* path, char* const argv[], char* const envv[], pid_t pgid)
goto bad;
}
if (err = posix_spawn(&pid, path, NiL, &attr, argv, envv ? envv : environ))
goto bad;
{
if ((err != EPERM) || (err = posix_spawn(&pid, path, NiL, NiL, argv, envv ? envv : environ)))
goto bad;
}
posix_spawnattr_destroy(&attr);
#if _lib_posix_spawn < 2
if (waitpid(pid, &err, WNOHANG|WNOWAIT) == pid && EXIT_STATUS(err) == 127)
Expand Down

0 comments on commit 7d2bb8f

Please sign in to comment.