summaryrefslogtreecommitdiff
path: root/devel
diff options
context:
space:
mode:
authorjoerg <joerg@pkgsrc.org>2008-09-16 11:59:29 +0000
committerjoerg <joerg@pkgsrc.org>2008-09-16 11:59:29 +0000
commit1f0132f552aaee51d81eddf10bc3cadc2e6957ab (patch)
tree7aaeaabeec0edd2fa737f8f016e8c503c6408519 /devel
parentcb06fe749c29f6526afc74bb7de12392faa3ae02 (diff)
downloadpkgsrc-1f0132f552aaee51d81eddf10bc3cadc2e6957ab.tar.gz
Don't use sig_t, it doesn't exist on QNX. Conditionally use madvise or
posix_madvise if MADV_SEQUENTIAL or POSIX_MADV_SEQUENTIAL exist. As it is a hint for the VM subsystem, it doesn't hurt if neither is provided. Based on input from Sean Boudreau.
Diffstat (limited to 'devel')
-rw-r--r--devel/nbpatch/files/inp.c7
-rw-r--r--devel/nbpatch/files/util.c4
2 files changed, 8 insertions, 3 deletions
diff --git a/devel/nbpatch/files/inp.c b/devel/nbpatch/files/inp.c
index 35b578b9ef4..5fe498b6257 100644
--- a/devel/nbpatch/files/inp.c
+++ b/devel/nbpatch/files/inp.c
@@ -1,7 +1,7 @@
/*
* $OpenBSD: inp.c,v 1.34 2006/03/11 19:41:30 otto Exp $
* $DragonFly: src/usr.bin/patch/inp.c,v 1.6 2007/09/29 23:11:10 swildner Exp $
- * $NetBSD: inp.c,v 1.1.1.1 2008/09/10 11:03:21 joerg Exp $
+ * $NetBSD: inp.c,v 1.2 2008/09/16 11:59:29 joerg Exp $
*/
/*
@@ -273,8 +273,13 @@ plan_a(const char *filename)
}
close(ifd);
+#ifdef MADV_SEQUENTIAL
if (i_size)
madvise(i_womp, i_size, MADV_SEQUENTIAL);
+#elif defined(POSIX_MADV_SEQUENTIAL)
+ if (i_size)
+ posix_madvise(i_womp, i_size, POSIX_MADV_SEQUENTIAL);
+#endif
/* estimate the number of lines */
lines_allocated = i_size / 25;
diff --git a/devel/nbpatch/files/util.c b/devel/nbpatch/files/util.c
index ed9bbbc7842..c24c66bc9e4 100644
--- a/devel/nbpatch/files/util.c
+++ b/devel/nbpatch/files/util.c
@@ -1,7 +1,7 @@
/*
* $OpenBSD: util.c,v 1.32 2006/03/11 19:41:30 otto Exp $
* $DragonFly: src/usr.bin/patch/util.c,v 1.9 2007/09/29 23:11:10 swildner Exp $
- * $NetBSD: util.c,v 1.1.1.1 2008/09/10 11:03:22 joerg Exp $
+ * $NetBSD: util.c,v 1.2 2008/09/16 11:59:29 joerg Exp $
*/
/*
@@ -289,7 +289,7 @@ ask(const char *fmt, ...)
void
set_signals(int reset)
{
- static sig_t hupval, intval;
+ static void (*hupval)(int), (*intval)(int);
if (!reset) {
hupval = signal(SIGHUP, SIG_IGN);