0001: As previously discussed, rename DATADIR.
0002: New inclusion of setenv() needs a define test to use Win32 equivalent function.

Thanks,
Michael

>From 29203687eb19acfde07802497650f718bcc978bd Mon Sep 17 00:00:00 2001
From: Michael Cronenworth <[email protected]>
Date: Sat, 4 Oct 2014 15:39:08 -0500
Subject: [PATCH 1/2] makefile: Rename DATADIR to not conflict with Win32
 define

Signed-off-by: Michael Cronenworth <[email protected]>
---
 Makefile.am         | 2 +-
 trust/module.c      | 2 +-
 trust/test-module.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index ea87f6a..f310068 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -8,7 +8,7 @@ AM_CPPFLAGS = \
 	-I$(top_srcdir)/common \
 	-DBINDIR=\"$(bindir)\" \
 	-DBUILDDIR=\"$(abs_builddir)\" \
-	-DDATADIR=\"$(datadir)\" \
+	-DDATA_DIR=\"$(datadir)\" \
 	-DPRIVATEDIR=\"$(privatedir)\" \
 	-DSRCDIR=\"$(abs_srcdir)\" \
 	-DSYSCONFDIR=\"$(sysconfdir)\" \
diff --git a/trust/module.c b/trust/module.c
index 852d74f..7fce465 100644
--- a/trust/module.c
+++ b/trust/module.c
@@ -196,7 +196,7 @@ create_tokens_inlock (p11_array *tokens,
 		const char *label;
 	} labels[] = {
 		{ "~/", "User Trust" },
-		{ DATADIR, "Default Trust" },
+		{ DATA_DIR, "Default Trust" },
 		{ SYSCONFDIR, "System Trust" },
 		{ NULL },
 	};
diff --git a/trust/test-module.c b/trust/test-module.c
index 3eedc1b..b1ee5fd 100644
--- a/trust/test-module.c
+++ b/trust/test-module.c
@@ -315,7 +315,7 @@ test_get_token_info (void)
 	memset (&args, 0, sizeof (args));
 	args.pReserved = "paths='" \
 		SYSCONFDIR "/trust/input" P11_PATH_SEP \
-		DATADIR "/trust/fixtures/blah" P11_PATH_SEP \
+		DATA_DIR "/trust/fixtures/blah" P11_PATH_SEP \
 		"/some/other/path/the-basename'";
 	args.flags = CKF_OS_LOCKING_OK;
 
-- 
1.9.3

>From 90017716ed6fd514f7b4b2237a27835cf600c19b Mon Sep 17 00:00:00 2001
From: Michael Cronenworth <[email protected]>
Date: Sat, 4 Oct 2014 15:40:18 -0500
Subject: [PATCH 2/2] MinGW: Add OS test around environment setting calls

Signed-off-by: Michael Cronenworth <[email protected]>
---
 common/test-compat.c     | 4 ++++
 p11-kit/test-transport.c | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/common/test-compat.c b/common/test-compat.c
index 3af33ac..c51e901 100644
--- a/common/test-compat.c
+++ b/common/test-compat.c
@@ -90,7 +90,11 @@ test_secure_getenv (void)
 	char *path;
 	int ret;
 
+#ifdef OS_UNIX
 	setenv ("BLAH", "5", 1);
+#else
+	_putenv_s ("BLAH", "5");
+#endif
 
 	ret = p11_test_run_child (args, true);
 	assert_num_eq (ret, 5);
diff --git a/p11-kit/test-transport.c b/p11-kit/test-transport.c
index 397a65a..82e3776 100644
--- a/p11-kit/test-transport.c
+++ b/p11-kit/test-transport.c
@@ -74,7 +74,11 @@ setup_remote (void *unused)
 	test.user_config = p11_path_build (test.directory, "pkcs11.conf", NULL);
 	p11_test_file_write (NULL, test.user_config, data, strlen (data));
 
+#ifdef OS_UNIX
 	setenv ("P11_KIT_PRIVATEDIR", BUILDDIR, 1);
+#else
+	_putenv_s ("P11_KIT_PRIVATEDIR", BUILDDIR);
+#endif
 	data = "remote: |" BUILDDIR "/p11-kit/p11-kit remote " BUILDDIR "/.libs/mock-two.so\n";
 	p11_test_file_write (test.user_modules, "remote.module", data, strlen (data));
 
-- 
1.9.3

_______________________________________________
p11-glue mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/p11-glue

Reply via email to