forked from OSchip/llvm-project
[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:
parent
a3b8f998ac
commit
04e2f43756
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue