[PATCH] add Linux syscall wrappers and ThreadLister to sanitizer_common

Kostya Serebryany kcc at google.com
Tue Feb 26 05:38:32 PST 2013



================
Comment at: lib/sanitizer_common/sanitizer_linux.cc:613
@@ +612,3 @@
+    if ((char *)entry_ >= &buffer_[bytes_read_]) {
+      if (!GetDirectoryEntries()) {
+        return -1;
----------------
remove { }
also, this can be inside just one if

================
Comment at: lib/sanitizer_common/sanitizer_linux.cc:634
@@ +633,3 @@
+ThreadLister::~ThreadLister() {
+  if (descriptor_ >= 0) {
+    internal_close(descriptor_);
----------------
remove { }

================
Comment at: lib/sanitizer_common/sanitizer_linux.cc:609
@@ +608,3 @@
+  do {
+    if (error_) {
+      return -1;
----------------
remove { }

================
Comment at: lib/sanitizer_common/tests/sanitizer_linux_test.cc:82
@@ +81,3 @@
+  }
+  pthread_cancel(thread_id);
+}
----------------
can we call pthread_join after pthread_cancel? 


================
Comment at: lib/sanitizer_common/tests/sanitizer_linux_test.cc:54
@@ +53,3 @@
+
+  pthread_create_result = pthread_create(&thread_id, NULL, TIDReporterThread,
+                                         &thread_tid);
----------------
Maybe we better have a test with n (> 10) threads? 


http://llvm-reviews.chandlerc.com/D464



More information about the llvm-commits mailing list