sandbox: replace deprecated getenv() with env_get()
authorOsama Abdelkader <osama.abdelkader@gmail.com>
Tue, 2 Sep 2025 22:24:11 +0000 (00:24 +0200)
committerTom Rini <trini@konsulko.com>
Fri, 12 Sep 2025 20:35:46 +0000 (14:35 -0600)
use env_get() instead of getenv() for consistency.

Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
arch/sandbox/cpu/os.c

index f5c9a8a..adb6b58 100644 (file)
@@ -35,6 +35,7 @@
 #include <asm/state.h>
 #include <os.h>
 #include <rtc_def.h>
+#include <env.h>
 
 /* Environment variable for time offset */
 #define ENV_TIME_OFFSET "UBOOT_SB_TIME_OFFSET"
@@ -283,7 +284,7 @@ int os_unmap(void *buf, int size)
 
 int os_persistent_file(char *buf, int maxsize, const char *fname)
 {
-       const char *dirname = getenv("U_BOOT_PERSISTENT_DATA_DIR");
+       const char *dirname = env_get("U_BOOT_PERSISTENT_DATA_DIR");
        char *ptr;
        int len;
 
@@ -1014,7 +1015,7 @@ long os_get_time_offset(void)
 {
        const char *offset;
 
-       offset = getenv(ENV_TIME_OFFSET);
+       offset = env_get(ENV_TIME_OFFSET);
        if (offset)
                return strtol(offset, NULL, 0);
        return 0;
@@ -1132,7 +1133,7 @@ static void *fuzzer_thread(void * ptr)
        const char *fuzz_test;
 
        /* Find which test to run from an environment variable. */
-       fuzz_test = getenv("UBOOT_SB_FUZZ_TEST");
+       fuzz_test = env_get("UBOOT_SB_FUZZ_TEST");
        if (!fuzz_test)
                os_abort();