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

[Xen-changelog] [xen staging] tools/shim: Fix race condition creating linkfarm.stamp



commit bf82703e8df0486cf0571d99c8f8d44991cfb8c9
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Thu Aug 29 18:19:25 2019 +0100
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Tue Sep 3 14:48:45 2019 +0100

    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@xxxxxxxxxx>
    Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 tools/firmware/xen-dir/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/firmware/xen-dir/Makefile b/tools/firmware/xen-dir/Makefile
index 697bbbd57b..df3f5a7006 100644
--- a/tools/firmware/xen-dir/Makefile
+++ b/tools/firmware/xen-dir/Makefile
@@ -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
--
generated by git-patchbot for /home/xen/git/xen.git#staging

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.