Re: [spice-common 8/8] Use g_getenv() instead of getenv()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 
> ---
>  common/log.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/common/log.c b/common/log.c
> index 8d47cb6..91d3181 100644
> --- a/common/log.c
> +++ b/common/log.c
> @@ -59,7 +59,7 @@ static GLogLevelFlags spice_log_level_to_glib(SpiceLogLevel
> level)
>  static void spice_log_set_debug_level(void)
>  {
>      if (glib_debug_level == 0) {
> -        char *debug_str = getenv("SPICE_DEBUG_LEVEL");
> +        char *debug_str = (char *)g_getenv("SPICE_DEBUG_LEVEL");

You should change the variable to const char *, we don't need to
change the environment.

>          if (debug_str != NULL) {
>              int debug_level;
>              char *debug_env;
> @@ -93,7 +93,7 @@ static void spice_log_set_debug_level(void)
>  static void spice_log_set_abort_level(void)
>  {
>      if (abort_level == -1) {
> -        char *abort_str = getenv("SPICE_ABORT_LEVEL");
> +        char *abort_str = (char *)g_getenv("SPICE_ABORT_LEVEL");
>          if (abort_str != NULL) {
>              GLogLevelFlags glib_abort_level;
>  

Frediano
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]