[libsanitizer] Notify the runtime about file being closed before the actual call to fclose().

This shall fix spurious false positive race reports between fclose() and fopen64().

llvm-svn: 208772
This commit is contained in:
Alexander Potapenko 2014-05-14 11:48:37 +00:00
parent a3b8f998ac
commit 04e2f43756
1 changed files with 1 additions and 2 deletions

View File

@ -4023,7 +4023,6 @@ INTERCEPTOR(int, fflush, __sanitizer_FILE *fp) {
INTERCEPTOR(int, fclose, __sanitizer_FILE *fp) {
void *ctx;
COMMON_INTERCEPTOR_ENTER(ctx, fclose, fp);
int res = REAL(fclose)(fp);
if (fp) {
COMMON_INTERCEPTOR_FILE_CLOSE(ctx, fp);
const FileMetadata *m = GetInterceptorMetadata(fp);
@ -4032,7 +4031,7 @@ INTERCEPTOR(int, fclose, __sanitizer_FILE *fp) {
DeleteInterceptorMetadata(fp);
}
}
return res;
return REAL(fclose)(fp);
}
#define INIT_FCLOSE COMMON_INTERCEPT_FUNCTION(fclose);
#else