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

Re: [Libguestfs] [PATCH] daemon/Win32: Replace setenv with Win32 equivalent.



Richard W.M. Jones wrote:
> Subject: [PATCH 4/7] daemon/Win32: Replace setenv with Win32 equivalent.
...
> +#ifdef HAVE_WINDOWS_H
> +#include <windows.h>
> +#endif
> +
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <string.h>
> @@ -167,6 +171,9 @@ main (int argc, char *argv[])
>      perror ("sigaction SIGPIPE"); /* but try to continue anyway ... */
>  #endif
>
> +#ifdef WIN32
> +#define setenv(n,v,f) _putenv(n "=" v)
> +#endif
>    /* Set up a basic environment.  After we are called by /init the
>     * environment is essentially empty.
>     * https://bugzilla.redhat.com/show_bug.cgi?id=502074#c5

ACK,
It's slightly more readable with nesting-reflecting indentation:

#ifdef HAVE_WINDOWS_H
# include <windows.h>
#endif

...

#ifdef WIN32
# define setenv(n,v,f) _putenv(n "=" v)
#endif


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