summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2016-03-05 20:10:25 +0000
committerVedant Kumar <vsk@apple.com>2016-03-05 20:10:25 +0000
commite55855f3628fd45d15b04e6973933b5d79a4b4a5 (patch)
tree65514dcd0b94a043507375a1a4c349208844aa0b
parent42083810162e4903115f5632e98fd78f25682c83 (diff)
downloadbcm5719-llvm-e55855f3628fd45d15b04e6973933b5d79a4b4a5.tar.gz
bcm5719-llvm-e55855f3628fd45d15b04e6973933b5d79a4b4a5.zip
[GCDA] Unlock arc file before closing it
The GCDA writer closed the arc file before unlocking it. This causes an EBADF while unlocking the file, and opens us up to racy behavior. Fixes PR26847. llvm-svn: 262779
-rw-r--r--compiler-rt/lib/profile/GCDAProfiling.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler-rt/lib/profile/GCDAProfiling.c b/compiler-rt/lib/profile/GCDAProfiling.c
index 44c0569e09d..1079f242406 100644
--- a/compiler-rt/lib/profile/GCDAProfiling.c
+++ b/compiler-rt/lib/profile/GCDAProfiling.c
@@ -486,8 +486,8 @@ void llvm_gcda_end_file() {
unmap_file();
}
- fclose(output_file);
flock(fd, LOCK_UN);
+ fclose(output_file);
output_file = NULL;
write_buffer = NULL;
}
OpenPOWER on IntegriCloud