]> git.plutz.net Git - lobster/blobdiff - therapies/update_therapy.sh
avoid race condition by using per-process temp files
[lobster] / therapies / update_therapy.sh
index 70fdea2930a23b0391a1ec7b58df693f8e5e8b07..0474b3b3be6d608f4db5975b93b03dc1b21c2c4a 100755 (executable)
@@ -21,7 +21,7 @@
 tpy="$(POST id)"
 
 tpyfile="$_DATA/therapies/${tpy}.tpy"
-tempfile="$_DATA/temp/${tpy}.tpy"
+tempfile="$_DATA/temp/${tpy}.$$.tpy"
 
 if [ "$(POST tid)" != "$(transid "$tpyfile")" ]; then
   if [ "$(POST autosubmit)" = "true" ]; then