mesa: allow user to set MESA_NO_ERROR=0
authorEric Engestrom <eric.engestrom@imgtec.com>
Wed, 6 Sep 2017 14:24:02 +0000 (14:24 +0000)
committerEric Engestrom <eric@engestrom.ch>
Thu, 7 Sep 2017 07:54:44 +0000 (08:54 +0100)
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102530
Cc: Michel Dänzer <michel@daenzer.net>
Cc: Alexandre Demers <alexandre.f.demers@gmail.com>
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
src/mesa/main/context.c

index cc37a0dc4dca538bd43616506b369facdfcbf073..dad3ab39f848f1f705e324aa8077a995f1aecfe4 100644 (file)
 #include "shared.h"
 #include "shaderobj.h"
 #include "shaderimage.h"
+#include "util/debug.h"
 #include "util/disk_cache.h"
 #include "util/strtod.h"
 #include "stencil.h"
@@ -1217,7 +1218,7 @@ _mesa_initialize_context(struct gl_context *ctx,
    /* KHR_no_error is likely to crash, overflow memory, etc if an application
     * has errors so don't enable it for setuid processes.
     */
-   if (getenv("MESA_NO_ERROR")) {
+   if (env_var_as_boolean("MESA_NO_ERROR", false)) {
 #if !defined(_WIN32)
       if (geteuid() == getuid())
 #endif