From 3c8490a877d9c21f3b8963b24066b605de306576 Mon Sep 17 00:00:00 2001 From: Eric Engestrom Date: Tue, 30 Jan 2024 14:30:31 +0000 Subject: [PATCH] util: simplify logic in __normal_user() Cc: mesa-stable Part-of: (cherry picked from commit afd4e633eecb03a548b06db73a5d70067413a4c2) --- .pick_status.json | 2 +- src/util/u_debug.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index f052f8174fa..4c039b4f573 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -214,7 +214,7 @@ "description": "util: simplify logic in __normal_user()", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/util/u_debug.h b/src/util/u_debug.h index dff5db17bc5..69e0430d09b 100644 --- a/src/util/u_debug.h +++ b/src/util/u_debug.h @@ -396,11 +396,11 @@ debug_get_option_ ## suffix (void) \ static inline bool __normal_user(void) { -#if !defined(_WIN32) - if (geteuid() != getuid()) - return false; -#endif +#if defined(_WIN32) return true; +#else + return geteuid() == getuid(); +#endif } #define DEBUG_GET_ONCE_BOOL_OPTION(sufix, name, dfault) \