Bug 984196 - glxtest should use _exit instead of exit. r=bgirard

--HG--
extra : rebase_source : 3bba6badd7e5a4031ad402cf88f7e0a15f4ba386
This commit is contained in:
Viktor Stanchev 2014-03-28 16:06:18 -04:00
parent 77915404c0
commit eb9ab3108c
3 changed files with 37 additions and 4 deletions

View File

@ -49,3 +49,15 @@
obj:/lib/libgobject-2.0.so.0.2200.5
...
}
###################################
# Leaks in short lived precesses #
###################################
{
Bug 984196
Memcheck:Leak
...
fun:glxtest
...
}

View File

@ -71,3 +71,15 @@
fun:gdk_display_open
...
}
###################################
# Leaks in short lived precesses #
###################################
{
Bug 984196
Memcheck:Leak
...
fun:glxtest
...
}

View File

@ -83,7 +83,7 @@ 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
@ -97,11 +97,18 @@ x_error_handler(Display *, XErrorEvent *ev)
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()
// glxtest is declared inside extern "C" so that the name is not mangled.
// The name is used in build/valgrind/x86_64-redhat-linux-gnu.sup to suppress
// memory leak errors because we run it inside a short lived fork and we don't
// care about leaking memory
extern "C" {
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
@ -245,6 +252,8 @@ static void glxtest()
write(write_end_of_the_pipe, buf, length);
}
}
/** \returns true in the child glxtest process, false in the parent process */
bool fire_glxtest_process()
{
@ -267,7 +276,7 @@ bool fire_glxtest_process()
write_end_of_the_pipe = pfd[1];
glxtest();
close(pfd[1]);
exit(0);
_exit(0);
}
close(pfd[1]);