Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/share/mk Create the INFODIRFILE if it does not exist, so tha...



details:   https://anonhg.NetBSD.org/src/rev/f01ca4ac8f8e
branches:  trunk
changeset: 374545:f01ca4ac8f8e
user:      christos <christos%NetBSD.org@localhost>
date:      Mon May 01 20:22:18 2023 +0000

description:
Create the INFODIRFILE if it does not exist, so that we can take a lock
on it. Hopefully fixes a race condition where two parallel makes attempt
to create the file at the same time.

diffstat:

 share/mk/bsd.info.mk |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r ebc1e6b06253 -r f01ca4ac8f8e share/mk/bsd.info.mk
--- a/share/mk/bsd.info.mk      Mon May 01 16:35:47 2023 +0000
+++ b/share/mk/bsd.info.mk      Mon May 01 20:22:18 2023 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.info.mk,v 1.42 2019/01/21 21:11:54 christos Exp $
+#      $NetBSD: bsd.info.mk,v 1.43 2023/05/01 20:22:18 christos Exp $
 
 .include <bsd.init.mk>
 
@@ -42,7 +42,7 @@ INFODIRFILE=${DESTDIR}${INFODIR}/dir
            -g ${INFOGRP_${.ALLSRC:T}:U${INFOGRP}} \
            -m ${INFOMODE_${.ALLSRC:T}:U${INFOMODE}} \
            ${.ALLSRC} ${.TARGET}
-       @[ -f ${INFODIRFILE} ] &&                                       \
+       @[ -f ${INFODIRFILE} ] || touch ${INFODIRFILE};                 \
        while ! ln ${INFODIRFILE} ${INFODIRFILE}.lock 2> /dev/null;     \
                do sleep 1; done;                                       \
        ${TOOL_INSTALL_INFO} -d ${INFODIRFILE} -r ${.TARGET} 2> /dev/null; \



Home | Main Index | Thread Index | Old Index