diff options
author | joerg <joerg@pkgsrc.org> | 2008-09-16 11:59:29 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2008-09-16 11:59:29 +0000 |
commit | 17919322b76763bc6a707a686cb383dbfca0478b (patch) | |
tree | 7aaeaabeec0edd2fa737f8f016e8c503c6408519 /devel/nbpatch/files | |
parent | 41d9facf16e4be97c89d6bb2bef3c0c1518c4dd9 (diff) | |
download | pkgsrc-17919322b76763bc6a707a686cb383dbfca0478b.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/nbpatch/files')
-rw-r--r-- | devel/nbpatch/files/inp.c | 7 | ||||
-rw-r--r-- | devel/nbpatch/files/util.c | 4 |
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); |