Browse Source

ez-ipupdate: Fix build with clang

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Khem Raj 2 years ago
parent
commit
5408788e2b

+ 6 - 5
meta-networking/recipes-connectivity/ez-ipupdate/ez-ipupdate_3.0.11b7.bb

@@ -5,11 +5,12 @@ LICENSE = "GPL-2.0-only"
 LIC_FILES_CHKSUM = "file://COPYING;md5=7783169b4be06b54e86730eb01bc3a31"
 
 SRC_URI = "http://sourceforge.net/projects/ez-ipupdate/files/${BPN}/${PV}/${BPN}-${PV}.tar.gz \
-    file://Makefile.am.patch \
-    file://cache_file.c.patch \
-    file://conf_file.c.patch \
-    file://wformat.patch \
-    "
+           file://Makefile.am.patch \
+           file://cache_file.c.patch \
+           file://conf_file.c.patch \
+           file://wformat.patch \
+           file://0001-ez-ipupdate-Include-time.h-for-time-API-prototype.patch \
+           "
 SRC_URI[md5sum] = "525be4550b4461fdf105aed8e753b020"
 SRC_URI[sha256sum] = "a15ec0dc0b78ec7578360987c68e43a67bc8d3591cbf528a323588830ae22c20"
 

+ 44 - 0
meta-networking/recipes-connectivity/ez-ipupdate/files/0001-ez-ipupdate-Include-time.h-for-time-API-prototype.patch

@@ -0,0 +1,44 @@
+From 6c8fe883df993b9e7987c8f1c849962f8007a373 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 29 Aug 2022 12:50:37 -0700
+Subject: [PATCH] ez-ipupdate: Include time.h for time() API prototype
+
+Fix printf format specifiers for snprintf
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ ez-ipupdate.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/ez-ipupdate.c b/ez-ipupdate.c
+index 15a4c13..5cbe7f3 100644
+--- a/ez-ipupdate.c
++++ b/ez-ipupdate.c
+@@ -38,6 +38,8 @@
+ #  include <config.h>
+ #endif
+ 
++#include <time.h>
++
+ // you man very well need to edit this, don't worry though, email is only sent
+ // if bad things happend and it has to exit when in daemon mode.
+ #define SEND_EMAIL_CMD "mail"
+@@ -2483,7 +2485,7 @@ int DHS_update_entry(void)
+   p += strlen(p);
+   limit = BUFFER_SIZE - 1 - strlen(buf);
+ 
+-  snprintf(buf, BUFFER_SIZE, "Content-length: %d\015\012", strlen(putbuf));
++  snprintf(buf, BUFFER_SIZE, "Content-length: %lu\015\012", strlen(putbuf));
+   output(buf);
+   snprintf(buf, BUFFER_SIZE, "\015\012");
+   output(buf);
+@@ -2620,7 +2622,7 @@ int DHS_update_entry(void)
+     p += strlen(p);
+     limit = BUFFER_SIZE - 1 - strlen(buf);
+ 
+-    snprintf(buf, BUFFER_SIZE, "Content-length: %d\015\012", strlen(putbuf));
++    snprintf(buf, BUFFER_SIZE, "Content-length: %lu\015\012", strlen(putbuf));
+     output(buf);
+     snprintf(buf, BUFFER_SIZE, "\015\012");
+     output(buf);