treewide: Replace the usage of setenv manually and #include "util/os_misc.h" when needed

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Antonio Ospite <antonio.ospite@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38640>
This commit is contained in:
Yonggang Luo 2025-11-25 05:20:09 +08:00 committed by Marge Bot
parent 5ab8148f23
commit d277dfdd76
8 changed files with 14 additions and 6 deletions

View file

@ -13,6 +13,8 @@
#include <string>
#include <unordered_map>
#include "util/os_misc.h"
#define FUNCTION_LIST \
ITEM(CreateInstance) \
ITEM(DestroyInstance) \

View file

@ -1022,7 +1022,7 @@ agxdecode_dump_file_open(void)
return;
/* This does a os_get_option every frame, so it is possible to use
* setenv to change the base at runtime.
* os_set_option to change the base at runtime.
*/
const char *dump_file_base =
os_get_option("AGXDECODE_DUMP_FILE") ?: "agxdecode.dump";

View file

@ -13,6 +13,8 @@
#include <sys/types.h>
#include <sys/wait.h>
#include "util/os_misc.h"
#include "pager.h"
static pid_t pager_pid;

View file

@ -440,7 +440,7 @@ drm_shim_driver_init(void)
nouveau_driver_get_device_info();
/* Ask userspace to consider all fences completed. */
setenv("NOUVEAU_DISABLE_FENCES", "true", true);
os_set_option("NOUVEAU_DISABLE_FENCES", "true", true);
/* nothing looks at the pci id, so fix it to a GTX 780 */
static const char uevent_content[] =

View file

@ -252,7 +252,7 @@ pandecode_dump_file_open(struct pandecode_context *ctx)
simple_mtx_assert_locked(&ctx->lock);
/* This does a os_get_option every frame, so it is possible to use
* setenv to change the base at runtime.
* os_set_option to change the base at runtime.
*/
const char *dump_file_base =
debug_get_option("PANDECODE_DUMP_FILE", "pandecode.dump");

View file

@ -25,6 +25,7 @@
#define DISK_CACHE_OS_H
#include "util/u_queue.h"
#include "util/disk_cache.h"
#if DETECT_OS_WINDOWS

View file

@ -39,9 +39,10 @@
#include <utime.h>
#include "util/detect_os.h"
#include "util/mesa-sha1.h"
#include "util/disk_cache.h"
#include "util/disk_cache_os.h"
#include "util/disk_cache.h"
#include "util/mesa-sha1.h"
#include "util/os_misc.h"
#include "util/ralloc.h"
#ifdef FOZ_DB_UTIL_DYNAMIC_LIST

View file

@ -23,7 +23,9 @@
#include <gtest/gtest.h>
#include <driconf.h>
#include <xmlconfig.h>
#include "util/xmlconfig.h"
#include "util/os_misc.h"
class xmlconfig_test : public ::testing::Test {
protected: