gspawn: Retry on EBUSY errors from dup2()

`man dup2` says that on Linux, dup2() can return `EBUSY` if the
operation needs to be retried (in addition to returning `EINTR` in other
cases where it needs to be retried).

Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
Philip Withnall 2019-09-26 14:13:01 +01:00
parent eae72c3597
commit 1097b50c1c

View File

@ -1297,7 +1297,7 @@ sane_dup2 (gint fd1, gint fd2)
do do
ret = dup2 (fd1, fd2); ret = dup2 (fd1, fd2);
while (ret < 0 && errno == EINTR); while (ret < 0 && (errno == EINTR || errno == EBUSY));
return ret; return ret;
} }