summaryrefslogtreecommitdiff
path: root/tests/shm.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/shm.c')
-rw-r--r--tests/shm.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/tests/shm.c b/tests/shm.c
index 26c5160..69d683f 100644
--- a/tests/shm.c
+++ b/tests/shm.c
@@ -10,6 +10,7 @@
#include <dlfcn.h>
#include "../shm/dconf-shm.h"
+#include "../shm/dconf-shm-mockable.h"
#include "tmpdir.h"
static void
@@ -87,29 +88,18 @@ test_flag_nonexistent (void)
dconf_shm_flag ("does-not-exist");
}
-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
-#define PWRITE_SYM "pwrite64"
-#else
-#define PWRITE_SYM "pwrite"
-#endif
-
static gboolean should_fail_pwrite;
/* interpose */
ssize_t
-pwrite (int fd, const void *buf, size_t count, off_t offset)
+dconf_shm_pwrite (int fd, const void *buf, size_t count, off_t offset)
{
- static ssize_t (* real_pwrite) (int, const void *, size_t, off_t);
-
- if (!real_pwrite)
- real_pwrite = dlsym (RTLD_NEXT, PWRITE_SYM);
-
if (should_fail_pwrite)
{
errno = ENOSPC;
return -1;
}
- return (* real_pwrite) (fd, buf, count, offset);
+ return pwrite (fd, buf, count, offset);
}
static void