[sanitizer] Fix error checking in ThreadLister
llvm-svn: 331735
This commit is contained in:
parent
47db4e6e5b
commit
4199dbd633
|
@ -917,7 +917,8 @@ ThreadLister::ThreadLister(int pid) : pid_(pid), buffer_(4096) {
|
|||
}
|
||||
|
||||
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(InternalMmapVector<int> *threads) {
|
|||
}
|
||||
|
||||
ThreadLister::~ThreadLister() {
|
||||
if (descriptor_ >= 0)
|
||||
if (!internal_iserror(descriptor_))
|
||||
internal_close(descriptor_);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue