apenwarr-redo/t/204-makeflags/all.do
Avery Pennarun 3dbdfbc06f Better handling if parent closes REDO_CHEATFDS or MAKEFLAGS fds.
Silently recover if REDO_CHEATFDS file descriptors are closed, because
they aren't completely essential and MAKEFLAGS-related warnings already
get printed if all file descriptors have been closed.

If MAKEFLAGS --jobserver-auth flags are closed, improve the error
message so that a) it's a normal error instead of an exception and b)
we link to documentation about why it happens.  Also write some more
detailed documentation about what's going on here.
2019-01-18 00:11:48 +00:00

16 lines
761 B
Text

# Make sure we can survive if a process closes all file descriptors,
# including any jobserver file descriptors, as long as they also
# unset MAKEFLAGS.
redo-ifchange ../../redo/py
# If we leave MAKEFLAGS set, then it's fair game to complain that the
# advertised file descriptors are gone, because GNU make also complains.
# (Although they only warn while we abort. They can't abort so that
# they don't break backward compat, but we have no such constraint, because
# redo has always failed for that case.)
#
# On the other hand, we shouldn't have to unset REDO_CHEATFDS, both for
# backward compatibility, and because REDO_CHEATFDS is undocumented.
# redo should recover silently from that problem.
unset MAKEFLAGS
../../redo/py ./closefds.py redo noflags