tools/shim: Fix race condition creating linkfarm.stamp

In the case the while loop gets interrupted, the target musn't appear as
up-to-date.  The mov $X.tmp $X must be the last action of the rule.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
This commit is contained in:
Andrew Cooper committed 2019-09-03 14:48:45 +01:00
1 parent 63feb88edf
commit bf82703e8d
1 file changed
+2 -2
+2 -2
View File
@@ -32,9 +32,9 @@ linkfarm.stamp: $(DEP_DIRS) $(DEP_FILES) FORCE
echo $(f) >> linkfarm.stamp.tmp ;)
cmp -s linkfarm.stamp.tmp linkfarm.stamp && \
rm linkfarm.stamp.tmp || { \
cat linkfarm.stamp.tmp | while read f; \
do rm -f "$(D)/$$f"; ln -s "$(XEN_ROOT)/$$f" "$(D)/$$f"; done; \
mv linkfarm.stamp.tmp linkfarm.stamp; \
cat linkfarm.stamp | while read f; \
do rm -f "$(D)/$$f"; ln -s "$(XEN_ROOT)/$$f" "$(D)/$$f"; done \
}
# Copy enough of the tree to build the shim hypervisor
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.