--- p11-kit-0.22.1/p11-kit/test-transport.c.orig	2014-11-11 10:58:28.829400000 +0300
+++ p11-kit-0.22.1/p11-kit/test-transport.c	2014-11-11 11:05:49.139400000 +0300
@@ -74,7 +74,13 @@
 	test.user_config = p11_path_build (test.directory, "pkcs11.conf", NULL);
 	p11_test_file_write (NULL, test.user_config, data, strlen (data));
 
+#ifdef __MINGW32__
+	const char *envstr;
+	envstr = "P11_KIT_PRIVATEDIR=" BUILDDIR "/p11-kit";
+	putenv(envstr);
+#else
 	setenv ("P11_KIT_PRIVATEDIR", BUILDDIR "/p11-kit", 1);
+#endif
 	data = "remote: |" BUILDDIR "/p11-kit/p11-kit" EXEEXT " remote " P11_MODULE_PATH "/mock-two" SHLEXT "\n";
 	p11_test_file_write (test.user_modules, "remote.module", data, strlen (data));
 	data = "remote: |" BUILDDIR "/p11-kit/p11-kit" EXEEXT " remote " P11_MODULE_PATH "/mock-five" SHLEXT "\nx-init-reserved: initialize-arg";
