parent
f7aeda1f07
commit
abc2c998d2
|
@ -1892,8 +1892,10 @@ TSAN_INTERCEPTOR(int, rmdir, char *path) {
|
|||
|
||||
TSAN_INTERCEPTOR(int, closedir, void *dirp) {
|
||||
SCOPED_TSAN_INTERCEPTOR(closedir, dirp);
|
||||
int fd = dirfd(dirp);
|
||||
FdClose(thr, pc, fd);
|
||||
if (dirp) {
|
||||
int fd = dirfd(dirp);
|
||||
FdClose(thr, pc, fd);
|
||||
}
|
||||
return REAL(closedir)(dirp);
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
// Check that closedir(NULL) is ok.
|
||||
// RUN: %clang -O2 %s -o %t && %run %t
|
||||
#include <sys/types.h>
|
||||
#include <dirent.h>
|
||||
int main() { closedir(0); }
|
Loading…
Reference in New Issue