1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-13 19:52:20 +00:00

libast: fix exec fail on interactive (Solaris patch 315-26773587)

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.
This commit is contained in:
Martijn Dekker 2021-01-09 01:58:23 +00:00
parent 4e67234ae8
commit 7d2bb8fdd9

View file

@ -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)