util: simplify logic in __normal_user()

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27378>
(cherry picked from commit afd4e633eecb03a548b06db73a5d70067413a4c2)
This commit is contained in:
Eric Engestrom 2024-01-30 14:30:31 +00:00 committed by Eric Engestrom
parent 26db70410e
commit 780b69ebfc
2 changed files with 5 additions and 5 deletions

View file

@ -214,7 +214,7 @@
"description": "util: simplify logic in __normal_user()", "description": "util: simplify logic in __normal_user()",
"nominated": true, "nominated": true,
"nomination_type": 0, "nomination_type": 0,
"resolution": 0, "resolution": 1,
"main_sha": null, "main_sha": null,
"because_sha": null, "because_sha": null,
"notes": null "notes": null

View file

@ -396,11 +396,11 @@ debug_get_option_ ## suffix (void) \
static inline bool static inline bool
__normal_user(void) __normal_user(void)
{ {
#if !defined(_WIN32) #if defined(_WIN32)
if (geteuid() != getuid())
return false;
#endif
return true; return true;
#else
return geteuid() == getuid();
#endif
} }
#define DEBUG_GET_ONCE_BOOL_OPTION(sufix, name, dfault) \ #define DEBUG_GET_ONCE_BOOL_OPTION(sufix, name, dfault) \