[compiler-rt] r331735 - [sanitizer] Fix error checking in ThreadLister
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Mon May 7 21:56:58 PDT 2018
Author: vitalybuka
Date: Mon May 7 21:56:57 2018
New Revision: 331735
URL: http://llvm.org/viewvc/llvm-project?rev=331735&view=rev
Log:
[sanitizer] Fix error checking in ThreadLister
Modified:
compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc?rev=331735&r1=331734&r2=331735&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc Mon May 7 21:56:57 2018
@@ -917,7 +917,8 @@ ThreadLister::ThreadLister(int pid) : pi
}
bool ThreadLister::ListThreads(InternalMmapVector<int> *threads) {
- if (!descriptor_) return false;
+ if (internal_iserror(descriptor_))
+ return false;
internal_lseek(descriptor_, 0, SEEK_SET);
threads->clear();
@@ -942,7 +943,7 @@ bool ThreadLister::ListThreads(InternalM
}
ThreadLister::~ThreadLister() {
- if (descriptor_ >= 0)
+ if (!internal_iserror(descriptor_))
internal_close(descriptor_);
}
More information about the llvm-commits
mailing list