daemon/Win32: Replace setenv with Win32 equivalent.
authorRichard Jones <rjones@redhat.com>
Wed, 25 Nov 2009 14:53:17 +0000 (14:53 +0000)
committerRichard Jones <rjones@redhat.com>
Wed, 25 Nov 2009 16:28:26 +0000 (16:28 +0000)
daemon/guestfsd.c

index f31f1f2..64cf87f 100644 (file)
 
 #define _BSD_SOURCE            /* for daemon(3) */
 
+#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