diff --git a/patches/client.patch b/patches/patch-client.c similarity index 100% rename from patches/client.patch rename to patches/patch-client.c diff --git a/patches/config.patch b/patches/patch-config.c similarity index 100% rename from patches/config.patch rename to patches/patch-config.c diff --git a/patches/imsg.patch b/patches/patch-imsg.c similarity index 100% rename from patches/imsg.patch rename to patches/patch-imsg.c diff --git a/patches/patch-log.c b/patches/patch-log.c new file mode 100644 index 0000000..e613bf2 --- /dev/null +++ b/patches/patch-log.c @@ -0,0 +1,23 @@ +$FreeBSD: head/net/openntpd/files/patch-log.c 340725 2014-01-22 17:40:44Z mat $ +--- log.c.orig 2007-08-22 23:04:30.000000000 +0200 ++++ log.c 2009-08-01 22:08:01.000000000 +0200 +@@ -26,6 +26,10 @@ + + #include "ntpd.h" + ++#ifndef LOG_NTP ++#define LOG_NTP LOG_DAEMON ++#endif ++ + int debug; + extern int debugsyslog; + +@@ -39,7 +43,7 @@ log_init(int n_debug) + debug = n_debug; + + if (!debug) +- openlog(__progname, LOG_PID | LOG_NDELAY, LOG_DAEMON); ++ openlog(__progname, LOG_PID | LOG_NDELAY, LOG_NTP); + + tzset(); + } diff --git a/patches/ntp.patch b/patches/patch-ntp.c similarity index 100% rename from patches/ntp.patch rename to patches/patch-ntp.c diff --git a/patches/patch-ntpd.c b/patches/patch-ntpd.c new file mode 100644 index 0000000..d83d5c3 --- /dev/null +++ b/patches/patch-ntpd.c @@ -0,0 +1,10 @@ +--- ntpd.orig 2014-12-28 11:51:56.363211155 -0600 ++++ ntpd.c 2014-12-28 11:52:00.971211255 -0600 +@@ -30,6 +30,7 @@ + #include + #include + #include ++#include + #include + #include + diff --git a/patches/ntpd.patch b/patches/patch-ntpd.h similarity index 71% rename from patches/ntpd.patch rename to patches/patch-ntpd.h index 09a28a6..42c3dd1 100644 --- a/patches/ntpd.patch +++ b/patches/patch-ntpd.h @@ -1,13 +1,3 @@ ---- ntpd.orig 2014-12-28 11:51:56.363211155 -0600 -+++ ntpd.c 2014-12-28 11:52:00.971211255 -0600 -@@ -30,6 +30,7 @@ - #include - #include - #include -+#include - #include - #include - --- ntpd.orig Sun Dec 28 16:11:35 2014 +++ ntpd.h Sun Dec 28 16:12:14 2014 @@ -28,7 +28,6 @@ diff --git a/patches/parse.patch b/patches/patch-parse.y similarity index 100% rename from patches/parse.patch rename to patches/patch-parse.y diff --git a/patches/server.patch b/patches/patch-server.c similarity index 100% rename from patches/server.patch rename to patches/patch-server.c diff --git a/patches/util.patch b/patches/patch-util.c similarity index 100% rename from patches/util.patch rename to patches/patch-util.c diff --git a/update.sh b/update.sh index c9f5b04..3f5e4aa 100755 --- a/update.sh +++ b/update.sh @@ -33,7 +33,7 @@ cp $libc_inc/sha2.h include/sha2_openbsd.h cp $libutil_src/imsg.h include/ cp $libutil_src/imsg.c compat/ cp $libutil_src/imsg-buffer.c compat/ -(cd compat; $PATCH < $patches/imsg.patch) +(cd compat; $PATCH < $patches/patch-imsg.c) for i in explicit_bzero.c strlcpy.c strlcat.c strndup.c strnlen.c; do $CP $libc_src/string/$i compat @@ -53,13 +53,11 @@ $CP $libcrypto_src/crypto/arc4random_*.h compat for i in client.c config.c control.c log.c ntp.c ntp.h ntp_dns.c ntp_msg.c \ ntpd.c ntpd.h parse.y sensors.c server.c util.c \ ntpctl.8 ntpd.8 ntpd.conf.5 ; do - echo Copying `basename $i` + file=`basename $i` + echo Copying $file $CP $ntpd_src/$i . + if [ -e $patches/patch-$file ]; then + echo Patching $file + $PATCH < $patches/patch-$file + fi done -$PATCH < $patches/client.patch -$PATCH < $patches/config.patch -$PATCH < $patches/ntp.patch -$PATCH < $patches/ntpd.patch -$PATCH < $patches/parse.patch -$PATCH < $patches/server.patch -$PATCH < $patches/util.patch