dconf 0.26.1
[git/cygwin-packages/dconf.git] / 0.22.0-cygwin-tests.patch
CommitLineData
8176d706
YS
1--- origsrc/dconf-0.22.0/tests/engine.c 2014-03-03 14:58:21.000000000 -0600
2+++ src/dconf-0.22.0/tests/engine.c 2015-01-04 13:16:04.982798900 -0600
3@@ -13,6 +13,9 @@
aebff6b2
YS
4 #include <stdio.h>
5 #include <dlfcn.h>
6 #include <math.h>
7+#ifdef __CYGWIN__
8+#include <sys/cygwin.h>
9+#endif
10
11 /* Interpose to catch fopen("/etc/dconf/profile/user") */
12 static const gchar *filename_to_replace;
8176d706 13@@ -23,6 +26,12 @@ fopen (const char *filename,
aebff6b2
YS
14 const char *mode)
15 {
16 static FILE * (*real_fopen) (const char *, const char *);
17+#ifdef __CYGWIN__
18+ static void *RTLD_NEXT = NULL;
19+
20+ if (!RTLD_NEXT)
21+ RTLD_NEXT = dlopen ("/usr/bin/cygwin1.dll", 0);
22+#endif
23
24 if (!real_fopen)
25 real_fopen = dlsym (RTLD_NEXT, "fopen");
8176d706 26@@ -1740,6 +1749,10 @@ test_sync (void)
aebff6b2
YS
27 int
28 main (int argc, char **argv)
29 {
30+#ifdef __CYGWIN__
31+ cygwin_internal (CW_HOOK, "fopen", fopen);
32+#endif
33+
8176d706 34 g_setenv ("XDG_RUNTIME_DIR", "/RUNTIME/", TRUE);
aebff6b2
YS
35 g_setenv ("XDG_CONFIG_HOME", "/HOME/.config", TRUE);
36 g_unsetenv ("DCONF_PROFILE");
8176d706
YS
37--- origsrc/dconf-0.22.0/tests/shm.c 2014-03-03 14:58:21.000000000 -0600
38+++ src/dconf-0.22.0/tests/shm.c 2015-01-04 13:16:04.998398900 -0600
39@@ -10,6 +10,9 @@
aebff6b2
YS
40 #include <fcntl.h>
41 #include <errno.h>
42 #include <dlfcn.h>
43+#ifdef __CYGWIN__
44+#include <sys/cygwin.h>
45+#endif
46
47 #include "../shm/dconf-shm.h"
48 #include "tmpdir.h"
8176d706 49@@ -91,6 +94,12 @@ ssize_t
aebff6b2
YS
50 pwrite (int fd, const void *buf, size_t count, off_t offset)
51 {
52 static ssize_t (* real_pwrite) (int, const void *, size_t, off_t);
53+#ifdef __CYGWIN__
54+ static void *RTLD_NEXT = NULL;
55+
56+ if (!RTLD_NEXT)
57+ RTLD_NEXT = dlopen ("/usr/bin/cygwin1.dll", 0);
58+#endif
59
60 if (!real_pwrite)
61 real_pwrite = dlsym (RTLD_NEXT, "pwrite");
8176d706 62@@ -143,6 +152,10 @@ main (int argc, char **argv)
aebff6b2
YS
63 gchar *temp;
64 gint status;
65
66+#ifdef __CYGWIN__
67+ cygwin_internal (CW_HOOK, "pwrite", pwrite);
68+#endif
69+
70 temp = dconf_test_create_tmpdir ();
71
72 g_setenv ("XDG_RUNTIME_DIR", temp, TRUE);
This page took 0.154137 seconds and 5 git commands to generate.