[PATCH] daemon/Win32: Replace setenv with Win32 equivalent.
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://et.redhat.com/~rjones/virt-df/
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
participants (2)
-
Jim Meyering -
Richard W.M. Jones