diff options
author | leot <leot@pkgsrc.org> | 2019-03-18 10:53:40 +0000 |
---|---|---|
committer | leot <leot@pkgsrc.org> | 2019-03-18 10:53:40 +0000 |
commit | 19ec56fa77ac14f226b53211c39d946defcbcdf9 (patch) | |
tree | 82b0b1f228e97a53d7a9b3c54d2f9ca674ea3653 /mail | |
parent | e3755e234f3dd82d7a0e29ac560c5e28f477f191 (diff) | |
download | pkgsrc-19ec56fa77ac14f226b53211c39d946defcbcdf9.tar.gz |
fdm: Adjust mremap(2) usage on NetBSD
MREMAP_MAYMOVE flag is the default behaviour on NetBSD and by
adjusting the single mremap() call it can be used on NetBSD too
(remove CONFIGURE_ENV injection kludge).
Thanks to <joerg> and <kamil> respectively for kindly pointing out
that and suggestions! (possible regressions are mine!)
Diffstat (limited to 'mail')
-rw-r--r-- | mail/fdm/Makefile | 7 | ||||
-rw-r--r-- | mail/fdm/distinfo | 3 | ||||
-rw-r--r-- | mail/fdm/patches/patch-shm-mmap.c | 18 |
3 files changed, 22 insertions, 6 deletions
diff --git a/mail/fdm/Makefile b/mail/fdm/Makefile index efc2fad011b..c3a2b4277c3 100644 --- a/mail/fdm/Makefile +++ b/mail/fdm/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.13 2019/03/17 21:33:03 leot Exp $ +# $NetBSD: Makefile,v 1.14 2019/03/18 10:53:40 leot Exp $ DISTNAME= fdm-2.0 -PKGREVISION= 1 +PKGREVISION= 2 CATEGORIES= mail MASTER_SITES= ${MASTER_SITE_GITHUB:=nicm/} @@ -17,9 +17,6 @@ INSTALLATION_DIRS+= ${EGDIR} ${DOCDIR} EGDIR= ${PREFIX}/share/examples/fdm DOCDIR= ${PREFIX}/share/doc/fdm -# Avoid mremap(2) due flags not available on NetBSD -CONFIGURE_ENV.NetBSD+= ac_cv_func_mremap=no - CFLAGS.NetBSD+= -D_OPENBSD_SOURCE # needed for strtonum(3) .include "options.mk" diff --git a/mail/fdm/distinfo b/mail/fdm/distinfo index d8440cab2b0..cb630bf8406 100644 --- a/mail/fdm/distinfo +++ b/mail/fdm/distinfo @@ -1,7 +1,8 @@ -$NetBSD: distinfo,v 1.11 2019/02/13 11:08:02 leot Exp $ +$NetBSD: distinfo,v 1.12 2019/03/18 10:53:40 leot Exp $ SHA1 (fdm-2.0.tar.gz) = 4da70cca5791457489d9e0a018706a6696609eab RMD160 (fdm-2.0.tar.gz) = b07dc4ee0b8de3362177d74bd935d1ae4dad961d SHA512 (fdm-2.0.tar.gz) = 9c321dfd200af7b7d396524a43a3ac4b569cddda0a2096122b935e9d7bdb8101f269341fae5bbd4ad8a2947312774da2d49e03eddc67c6ecbce4e1ff9488ebe2 Size (fdm-2.0.tar.gz) = 180662 bytes SHA1 (patch-Makefile.am) = 2169ebc8e7c920cdf8492ee2039b410f5a6e358c +SHA1 (patch-shm-mmap.c) = d6d961768b60e9174350dc7c6439c2d0be10ae1a diff --git a/mail/fdm/patches/patch-shm-mmap.c b/mail/fdm/patches/patch-shm-mmap.c new file mode 100644 index 00000000000..4cf0b1c5d20 --- /dev/null +++ b/mail/fdm/patches/patch-shm-mmap.c @@ -0,0 +1,18 @@ +$NetBSD: patch-shm-mmap.c,v 1.1 2019/03/18 10:53:41 leot Exp $ + +Adjust mremap(2) usage for NetBSD. + +--- shm-mmap.c.orig 2019-02-12 22:08:26.000000000 +0000 ++++ shm-mmap.c +@@ -218,7 +218,11 @@ shm_resize(struct shm *shm, size_t nmemb + return (NULL); + + #ifdef HAVE_MREMAP ++#if defined(__NetBSD__) ++ shm->data = mremap(shm->data, shm->size, NULL, newsize, 0); ++#else + shm->data = mremap(shm->data, shm->size, newsize, MREMAP_MAYMOVE); ++#endif + #else + shm->data = mmap(NULL, newsize, SHM_PROT, SHM_FLAGS, shm->fd, 0); + #endif |