pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/net/dhcpd-pools Extend the patch to src/getdata.c, so ...
details: https://anonhg.NetBSD.org/pkgsrc/rev/847f5d7e45ca
branches: trunk
changeset: 610760:847f5d7e45ca
user: he <he%pkgsrc.org@localhost>
date: Mon Nov 05 14:26:44 2012 +0000
description:
Extend the patch to src/getdata.c, so that the return value of
posix_fadvise() is checked instead of testing the value of errno
after the function has been called.
This should make this program work also on netbsd-5.
Bump PKGREVISION.
diffstat:
net/dhcpd-pools/Makefile | 4 +-
net/dhcpd-pools/distinfo | 4 +-
net/dhcpd-pools/patches/patch-src_getdata.c | 40 +++++++++++++++++++++++++++-
3 files changed, 42 insertions(+), 6 deletions(-)
diffs (80 lines):
diff -r 57cfbaa71b00 -r 847f5d7e45ca net/dhcpd-pools/Makefile
--- a/net/dhcpd-pools/Makefile Mon Nov 05 12:53:07 2012 +0000
+++ b/net/dhcpd-pools/Makefile Mon Nov 05 14:26:44 2012 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.5 2012/10/23 17:18:16 asau Exp $
+# $NetBSD: Makefile,v 1.6 2012/11/05 14:26:44 he Exp $
DISTNAME= dhcpd-pools-2.16
-PKGREVISION= 1
+PKGREVISION= 2
CATEGORIES= net
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=dhcpd-pools/}
diff -r 57cfbaa71b00 -r 847f5d7e45ca net/dhcpd-pools/distinfo
--- a/net/dhcpd-pools/distinfo Mon Nov 05 12:53:07 2012 +0000
+++ b/net/dhcpd-pools/distinfo Mon Nov 05 14:26:44 2012 +0000
@@ -1,7 +1,7 @@
-$NetBSD: distinfo,v 1.2 2011/07/20 07:03:53 adam Exp $
+$NetBSD: distinfo,v 1.3 2012/11/05 14:26:44 he Exp $
SHA1 (dhcpd-pools-2.16.tar.gz) = 747546172df1027a3ed743822b6593eb8d9a3c82
RMD160 (dhcpd-pools-2.16.tar.gz) = 646d172a5c6f1f2a5b7d800d732adbef248e8f21
Size (dhcpd-pools-2.16.tar.gz) = 367461 bytes
SHA1 (patch-src_dhcpd-pools.h) = 41fe0881bc3741189ea802337bab1ba4aaeeb9bc
-SHA1 (patch-src_getdata.c) = 66580946034e5c19257c449e1fb5e5e9daaaa319
+SHA1 (patch-src_getdata.c) = 4234ec99f8df193d56a2d818ff8951521a5c2a1d
diff -r 57cfbaa71b00 -r 847f5d7e45ca net/dhcpd-pools/patches/patch-src_getdata.c
--- a/net/dhcpd-pools/patches/patch-src_getdata.c Mon Nov 05 12:53:07 2012 +0000
+++ b/net/dhcpd-pools/patches/patch-src_getdata.c Mon Nov 05 14:26:44 2012 +0000
@@ -1,8 +1,9 @@
-$NetBSD: patch-src_getdata.c,v 1.1 2011/07/20 07:03:53 adam Exp $
+$NetBSD: patch-src_getdata.c,v 1.2 2012/11/05 14:26:44 he Exp $
Don't include features.h; move string.h to dhcpd-pools.h.
+Check return value of posix_fadvise(), not just whether errno != 0.
---- src/getdata.c.orig 2011-07-20 06:30:23.000000000 +0000
+--- src/getdata.c.orig 2011-07-10 22:30:00.000000000 +0000
+++ src/getdata.c
@@ -43,19 +43,12 @@ extern char *malloc();
#define EXIT_SUCCESS 0 /* Successful exit status. */
@@ -24,3 +25,38 @@
#include <netinet/in.h>
#include <stddef.h>
#include <stdint.h>
+@@ -89,15 +82,13 @@ int parse_leases(void)
+ err(EXIT_FAILURE, "parse_leases: %s", config.dhcpdlease_file);
+ }
+ #ifdef POSIX_FADV_WILLNEED
+- posix_fadvise(fileno(dhcpd_leases), 0, 0, POSIX_FADV_WILLNEED);
+- if (errno) {
++ if (posix_fadvise(fileno(dhcpd_leases), 0, 0, POSIX_FADV_WILLNEED) != 0) {
+ err(EXIT_FAILURE, "parse_leases: fadvise %s",
+ config.dhcpdlease_file);
+ }
+ #endif /* POSIX_FADV_WILLNEED */
+ #ifdef POSIX_FADV_SEQUENTIAL
+- posix_fadvise(fileno(dhcpd_leases), 0, 0, POSIX_FADV_SEQUENTIAL);
+- if (errno) {
++ if (posix_fadvise(fileno(dhcpd_leases), 0, 0, POSIX_FADV_SEQUENTIAL) != 0) {
+ err(EXIT_FAILURE, "parse_leases: fadvise %s",
+ config.dhcpdlease_file);
+ }
+@@ -269,14 +260,12 @@ void parse_config(int is_include, char *
+ err(EXIT_FAILURE, "parse_config: %s", config_file);
+ }
+ #ifdef POSIX_FADV_WILLNEED
+- posix_fadvise(fileno(dhcpd_config), 0, 0, POSIX_FADV_WILLNEED);
+- if (errno) {
++ if (posix_fadvise(fileno(dhcpd_config), 0, 0, POSIX_FADV_WILLNEED) != 0) {
+ err(EXIT_FAILURE, "parse_config: fadvise %s", config_file);
+ }
+ #endif /* POSIX_FADV_WILLNEED */
+ #ifdef POSIX_FADV_SEQUENTIAL
+- posix_fadvise(fileno(dhcpd_config), 0, 0, POSIX_FADV_SEQUENTIAL);
+- if (errno) {
++ if (posix_fadvise(fileno(dhcpd_config), 0, 0, POSIX_FADV_SEQUENTIAL) != 0) {
+ err(EXIT_FAILURE, "parse_config: fadvise %s", config_file);
+ }
+ #endif /* POSIX_FADV_SEQUENTIAL */
Home |
Main Index |
Thread Index |
Old Index