Skip to content

Commit

Permalink
Merge branch 'refs/heads/upstream-HEAD' into repo-HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
Delphix Engineering committed May 24, 2024
2 parents 64d2b68 + 16c73b8 commit 321daaf
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
next
----
* Minor cache improvements and a NULL-pointer dereference fix.
* Fix test suite for 32-bit architectures.

0.5.4
-----
Expand Down
2 changes: 2 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(off_t)
AC_SUBST(SIZEOF_OFF_T, $ac_cv_sizeof_off_t)

AC_CHECK_FUNCS(mmap64)

dnl This makes sure pkg.m4 is available.
m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])

Expand Down
13 changes: 12 additions & 1 deletion src/kdumpfile/test-fcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,20 @@ static char *mmapbuf;

static int failmmap;

#ifdef HAVE_MMAP64

#define STR_MMAP XSTRINGIFY(mmap64)
static void* (*orig_mmap)(void *addr, size_t length, int prot, int flags,
int fd, off64_t offset);

#else

#define STR_MMAP XSTRINGIFY(mmap)
static void* (*orig_mmap)(void *addr, size_t length, int prot, int flags,
int fd, off_t offset);

#endif

void *
mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset)
{
Expand Down Expand Up @@ -445,7 +456,7 @@ main(int argc, char **argv)
return TEST_ERR;
}

orig_mmap = dlsym(RTLD_NEXT, "mmap");
orig_mmap = dlsym(RTLD_NEXT, STR_MMAP);
if (!orig_mmap) {
fprintf(stderr, "Cannot get original mmap() address: %s\n",
dlerror());
Expand Down

0 comments on commit 321daaf

Please sign in to comment.