Merge "Add a filelock for in-place case" am: cdbab1ea51
am: 4bb43ed7a2
am: 87642d1daf
am: 1ef4defe98
am: 1002761b93
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/2092123 Change-Id: Ia67d3f953aa5409180986f9c6b410cc3cafb26de Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
348216c144
1 changed files with 6 additions and 0 deletions
|
@ -15,6 +15,7 @@ import (
|
|||
"os/exec"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"syscall"
|
||||
"unicode"
|
||||
|
||||
"github.com/google/blueprint/parser"
|
||||
|
@ -68,6 +69,11 @@ func processFile(filename string, in io.Reader, out io.Writer) error {
|
|||
return err
|
||||
}
|
||||
defer f.Close()
|
||||
|
||||
if *write {
|
||||
syscall.Flock(int(f.Fd()), syscall.LOCK_EX)
|
||||
}
|
||||
|
||||
in = f
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue