Bug 984196 - glxtest should use _exit instead of exit. r=bgirard
☠☠ backed out by 4d5074dfad5d ☠ ☠
authorViktor Stanchev <vstanchev@mozilla.com>
Mon, 24 Mar 2014 17:00:02 -0400
changeset 175107 7ba0551dd35d4eb2b48eb0b051f1aa225821ebae
parent 175106 db4bcc7605be26d94049bb9482ab028fbab5a024
child 175108 cdd9fffa7d4db124e7794ddd89d04d1415bb80c9
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersbgirard
bugs984196
milestone31.0a1
Bug 984196 - glxtest should use _exit instead of exit. r=bgirard
toolkit/xre/glxtest.cpp
--- a/toolkit/xre/glxtest.cpp
+++ b/toolkit/xre/glxtest.cpp
@@ -78,31 +78,31 @@ static func_ptr_type cast(void *ptr)
            reinterpret_cast<size_t>(ptr)
          );
 }
 
 static void fatal_error(const char *str)
 {
   write(write_end_of_the_pipe, str, strlen(str));
   write(write_end_of_the_pipe, "\n", 1);
-  exit(EXIT_FAILURE);
+  _exit(EXIT_FAILURE);
 }
 
 static int
 x_error_handler(Display *, XErrorEvent *ev)
 {
   enum { bufsize = 1024 };
   char buf[bufsize];
   int length = snprintf(buf, bufsize,
                         "X error occurred in GLX probe, error_code=%d, request_code=%d, minor_code=%d\n",
                         ev->error_code,
                         ev->request_code,
                         ev->minor_code);
   write(write_end_of_the_pipe, buf, length);
-  exit(EXIT_FAILURE);
+  _exit(EXIT_FAILURE);
   return 0;
 }
 
 static void glxtest()
 {
   // we want to redirect to /dev/null stdout, stderr, and while we're at it,
   // any PR logging file descriptors. To that effect, we redirect all positive
   // file descriptors up to what open() returns here. In particular, 1 is stdout and 2 is stderr.
@@ -262,16 +262,16 @@ bool fire_glxtest_process()
   }
   // The child exits early to avoid running the full shutdown sequence and avoid conflicting with threads 
   // we have already spawned (like the profiler).
   if (pid == 0) {
       close(pfd[0]);
       write_end_of_the_pipe = pfd[1];
       glxtest();
       close(pfd[1]);
-      exit(0);
+      _exit(0);
   }
 
   close(pfd[1]);
   mozilla::widget::glxtest_pipe = pfd[0];
   mozilla::widget::glxtest_pid = pid;
   return false;
 }