From 5ab8148f23c8cde9c72128aa906a1dc0affecdcf Mon Sep 17 00:00:00 2001 From: Yonggang Luo Date: Tue, 25 Nov 2025 18:03:30 +0800 Subject: [PATCH] util: Update os_get_option* comments to match os_set_option Signed-off-by: Yonggang Luo Reviewed-by: Antonio Ospite Part-of: --- src/util/os_misc.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/util/os_misc.h b/src/util/os_misc.h index 6a619c158b5..03cd59c3683 100644 --- a/src/util/os_misc.h +++ b/src/util/os_misc.h @@ -83,7 +83,8 @@ os_log_message(const char *message); /* - * Get an option. Should return NULL if specified option is not set. + * Get an option(environment variable or os property) in a platform independent way. + * Should return NULL if specified option for @name is not set. * It has the same disadvantage as getenv, see * https://wiki.sei.cmu.edu/confluence/display/c/ENV34-C.+Do+not+store+pointers+returned+by+certain+functions */ @@ -101,7 +102,8 @@ char * os_get_option_dup(const char *name); /* - * Get an option. Should return NULL if specified option is not set. + * Get an option(environment variable or os property) in a platform independent way. + * Should return NULL if specified option for @name is not set. * Same as `os_get_option()` but uses `secure_getenv()` instead of `getenv()` */ const char * @@ -118,12 +120,13 @@ char * os_get_option_secure_dup(const char *name); /* - * Get an option. Should return NULL if specified option is not set. + * Get an option(environment variable or os property) in a platform independent way. + * Should return NULL if specified option for @name is not set. * It's will save the option into hash table for the first time, and * for latter calling, it's will return the value comes from hash table * directly, and the returned value will always be valid before program exit - * The disadvantage is that setenv, unsetenv, putenv won't take effect - * after this function is called + * The disadvantage is that os_set_option won't take effect after this + * function is called */ const char * os_get_option_cached(const char *name);