[Mesa-dev] [PATCH] mesa: fix Windows build error related to getuid()

Timothy Arceri tarceri at itsqueeze.com
Wed Apr 19 23:18:27 UTC 2017


Thanks Brian.

Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>

On 20/04/17 04:14, Brian Paul wrote:
> getuid() and geteuid() are not present on Windows.
> ---
>  src/mesa/main/context.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
> index 984c9e0..3570f94 100644
> --- a/src/mesa/main/context.c
> +++ b/src/mesa/main/context.c
> @@ -1211,8 +1211,12 @@ _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") && geteuid() == getuid())
> -      ctx->Const.ContextFlags |= GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR;
> +   if (getenv("MESA_NO_ERROR")) {
> +#if !defined(_WIN32)
> +      if (geteuid() == getuid())
> +#endif
> +         ctx->Const.ContextFlags |= GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR;
> +   }
>
>     /* setup the API dispatch tables with all nop functions */
>     ctx->OutsideBeginEnd = _mesa_alloc_dispatch_table();
>


More information about the mesa-dev mailing list