pdnsd-alt: sync upstream

This commit is contained in:
Tianling Shen 2022-03-13 15:43:33 +00:00 committed by Beginner-Go
parent f0baf8da5c
commit c99bc9fe4a
3 changed files with 75 additions and 56 deletions

View File

@ -1,37 +0,0 @@
--- a/src/main.c
+++ b/src/main.c
@@ -219,6 +219,16 @@ static int check_ipv6()
*/
int main(int argc,char *argv[])
{
+#if DEBUG>0
+ {
+ int err;
+ /* Generate a key for storing our thread id's */
+ if ((err=pthread_key_create(&thrid_key, NULL)) != 0) {
+ log_error("pthread_key_create failed: %s",strerror(err));
+ _exit(1);
+ }
+ }
+#endif
int i,sig,pfd=-1; /* Initialized to inhibit compiler warning */
main_thrid=pthread_self();
@@ -626,17 +636,6 @@ int main(int argc,char *argv[])
pthread_sigmask(SIG_BLOCK,&sigs_msk,NULL);
#endif
-#if DEBUG>0
- {
- int err;
- /* Generate a key for storing our thread id's */
- if ((err=pthread_key_create(&thrid_key, NULL)) != 0) {
- log_error("pthread_key_create failed: %s",strerror(err));
- _exit(1);
- }
- }
-#endif
-
{
#if DEBUG>0
int thrdsucc=1;

View File

@ -0,0 +1,42 @@
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,5 @@
-SUBDIRS = src doc contrib
+SUBDIRS = src contrib
EXTRA_DIST = version ChangeLog.old COPYING.BSD README.par README.par.old PKGBUILD
--- a/Makefile.in
+++ b/Makefile.in
@@ -196,7 +196,7 @@ threadlib = @threadlib@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-SUBDIRS = src doc contrib
+SUBDIRS = src contrib
EXTRA_DIST = version ChangeLog.old COPYING.BSD README.par README.par.old PKGBUILD
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -15,7 +15,7 @@ EXTRA_DIST = make_rr_types_h.pl rr_types
## Try to do this last
-SUBDIRS = . pdnsd-ctl rc test
+SUBDIRS = . pdnsd-ctl
$(pdnsd_OBJECTS): rr_types.h
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -215,7 +215,7 @@ pdnsd_SOURCES = conf-parser.c conff.c co
freebsd_netinet_ip_icmp.h
EXTRA_DIST = make_rr_types_h.pl rr_types.in
-SUBDIRS = . pdnsd-ctl rc test
+SUBDIRS = . pdnsd-ctl
all: all-recursive
.SUFFIXES:

View File

@ -1,16 +1,3 @@
From 09171eef574503a82342a8b23d4a55b8a5286724 Mon Sep 17 00:00:00 2001
From: W_Y_CPP <383152993@qq.com>
Date: Sat, 1 Jan 2022 13:05:37 +0900
Subject: [PATCH] fix pdnsd alt build error with kernel_5.15
---
src/conff.h | 2 +-
src/dns.h | 2 +-
src/netdev.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/conff.h b/src/conff.h
index a07b1561b..c66d210aa 100644
--- a/src/conff.h
+++ b/src/conff.h
@@ -32,7 +32,7 @@
@ -22,8 +9,6 @@ index a07b1561b..c66d210aa 100644
#include "ipvers.h"
#include "list.h"
diff --git a/src/dns.h b/src/dns.h
index 0f6a4ac1e..ecc9680b2 100644
--- a/src/dns.h
+++ b/src/dns.h
@@ -27,7 +27,7 @@
@ -35,8 +20,39 @@ index 0f6a4ac1e..ecc9680b2 100644
#include <sys/types.h>
#include <inttypes.h>
#include "rr_types.h"
diff --git a/src/netdev.c b/src/netdev.c
index bd5f8c451..bfd5046df 100644
--- a/src/dns_answer.c
+++ b/src/dns_answer.c
@@ -37,7 +37,7 @@
#include <sys/uio.h>
#include <sys/types.h>
#ifdef HAVE_SYS_POLL_H
-#include <sys/poll.h>
+#include <poll.h>
#endif
#include <sys/param.h>
#include <netdb.h>
--- a/src/dns_query.c
+++ b/src/dns_query.c
@@ -23,7 +23,7 @@
#include <config.h>
#include <sys/types.h>
#ifdef HAVE_SYS_POLL_H
-#include <sys/poll.h>
+#include <poll.h>
#endif
#include <stdlib.h>
#include <netdb.h>
--- a/src/icmp.c
+++ b/src/icmp.c
@@ -28,7 +28,7 @@
#include <config.h>
#ifdef HAVE_SYS_POLL_H
-#include <sys/poll.h>
+#include <poll.h>
#endif
#include <sys/time.h>
#include <stdlib.h>
--- a/src/netdev.c
+++ b/src/netdev.c
@@ -59,7 +59,7 @@
@ -48,5 +64,3 @@ index bd5f8c451..bfd5046df 100644
#include <netdb.h>
#include <string.h>
#include <unistd.h>
--
2.17.1