diff --git a/.pick_status.json b/.pick_status.json index a78eb87e2be..cf49fdd52e1 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -104,7 +104,7 @@ "description": "util: Provide a secure_getenv fallback for platforms without it", "nominated": false, "nomination_type": 3, - "resolution": 4, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/meson.build b/meson.build index 2902c1019f6..9b892065a4b 100644 --- a/meson.build +++ b/meson.build @@ -1337,6 +1337,7 @@ functions_to_detect = { 'getrandom': '', 'qsort_s': '', 'posix_fallocate': '', + 'secure_getenv': '', } foreach f, prefix: functions_to_detect diff --git a/src/util/u_debug.h b/src/util/u_debug.h index 2f1a2dabed1..8e8319c0601 100644 --- a/src/util/u_debug.h +++ b/src/util/u_debug.h @@ -39,6 +39,7 @@ #define U_DEBUG_H_ #include +#include #include #if !defined(_WIN32) #include @@ -403,6 +404,13 @@ __normal_user(void) #endif } +#ifndef HAVE_SECURE_GETENV +static inline char *secure_getenv(const char *name) +{ + return getenv(name); +} +#endif + #define DEBUG_GET_ONCE_BOOL_OPTION(sufix, name, dfault) \ static bool \ debug_get_option_ ## sufix (void) \