summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2022-11-12 23:30:25 +0100
committerMichael Olbrich <m.olbrich@pengutronix.de>2022-11-13 11:00:00 +0100
commit8e7f5417d1f6b86635868c58700cfcae7a92cadd (patch)
tree23fb33812fa40f3371d67433d6363dc21e477b17
parent795b743f52c4064e144f1ce5af718b1c336cb2e6 (diff)
downloadptxdist-8e7f5417d1f6b86635868c58700cfcae7a92cadd.tar.gz
ptxdist-8e7f5417d1f6b86635868c58700cfcae7a92cadd.tar.xz
wrapper: don't try to write to the logfile if the fd was closed
Some build systems close extra fds, so check if the logfile fd is still open before using it. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r--scripts/wrapper/libwrapper.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/wrapper/libwrapper.sh b/scripts/wrapper/libwrapper.sh
index 36fa8f877..07a7a24ad 100644
--- a/scripts/wrapper/libwrapper.sh
+++ b/scripts/wrapper/libwrapper.sh
@@ -25,6 +25,11 @@ fi
CMD="${0##*/}"
FULL_CMD="$(readlink "${0%/*}/real/${CMD}")"
+# don't use PTXDIST_FD_LOGFILE if some build tool closed the fd
+if [ ! -e "/proc/self/fd/${PTXDIST_FD_LOGFILE}" ]; then
+ unset PTXDIST_FD_LOGFILE
+fi
+
wrapper_exec() {
PATH="$(echo "${PATH}" | sed "s;${PTXDIST_PATH_SYSROOT_HOST}/lib/wrapper:;;")"
if [ -n "${FAKEROOTKEY}" -o -z "${ICECC_VERSION}" -o ! -e "${ICECC_VERSION}" ]; then