[PATCH] D20048: [sanitizer] On OS X, exit the forked process gracefully when login_tty fails

Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 12 05:59:47 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL269289: [sanitizer] On OS X, exit the forked process gracefully when login_tty fails (authored by kuba.brecka).

Changed prior to commit:
  http://reviews.llvm.org/D20048?vs=56496&id=57025#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D20048

Files:
  compiler-rt/trunk/lib/sanitizer_common/sanitizer_mac.cc

Index: compiler-rt/trunk/lib/sanitizer_common/sanitizer_mac.cc
===================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_mac.cc
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_mac.cc
@@ -195,7 +195,11 @@
   }
   if (pid == 0) {
     close(master);
-    CHECK_EQ(login_tty(slave), 0);
+    if (login_tty(slave) != 0) {
+      // We already forked, there's not much we can do.  Let's quit.
+      Report("login_tty failed (errno %d)\n", errno);
+      internal__exit(1);
+    }
   } else {
     *amaster = master;
     close(slave);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20048.57025.patch
Type: text/x-patch
Size: 599 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160512/f0f2f5a1/attachment.bin>


More information about the llvm-commits mailing list