ports/86091: dns/totd: unbreak on !i386 systems
Johan van Selst
johans at stack.nl
Tue Sep 13 19:20:09 UTC 2005
>Number: 86091
>Category: ports
>Synopsis: dns/totd: unbreak on !i386 systems
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: update
>Submitter-Id: current-users
>Arrival-Date: Tue Sep 13 19:20:07 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator: Johan van Selst
>Release: FreeBSD 6.0-BETA4 amd64
>Organization:
>Environment:
System: FreeBSD hammer.stack.nl 6.0-BETA4 FreeBSD 6.0-BETA4 #2: Fri Sep 9 18:52:55 CEST 2005 root at hammer.stack.nl:/usr/obj/usr/src/sys/HAMMER amd64
>Description:
Remove careless 's/%zd/%d/g' hack.
Use %zd for size_t, %td for ptrdiff_t and %d for decimals.
Unfortunately this breaks compilation on i386 4.x systems
(where sprintf doesn't know these modifiers)
>How-To-Repeat:
>Fix:
diff -uNr totd/Makefile totd/Makefile
--- totd/Makefile Mon Sep 5 13:04:05 2005
+++ totd/Makefile Tue Sep 13 21:11:18 2005
@@ -22,12 +22,9 @@
.include <bsd.port.pre.mk>
-.if ${ARCH} != "i386"
-BROKEN= "Does not compile on !i386"
+.if ${OSVERSION} < 500000
+IGNORE= "Only for 5.0 and above"
.endif
-
-post-patch:
- @${REINPLACE_CMD} -e 's/%zd/%d/g' ${WRKSRC}/*.c
post-install:
${INSTALL_DATA} ${FILESDIR}/totd.conf.sample ${PREFIX}/etc
diff -uNr totd/files/patch-ne_mesg.c totd/files/patch-ne_mesg.c
--- totd/files/patch-ne_mesg.c Thu Jan 1 01:00:00 1970
+++ totd/files/patch-ne_mesg.c Tue Sep 13 21:03:17 2005
@@ -0,0 +1,36 @@
+--- ne_mesg.c.orig Mon Jul 4 11:09:22 2005
++++ ne_mesg.c Tue Sep 13 21:02:57 2005
+@@ -59,7 +59,7 @@
+
+ /* write qname */
+ if (T.debug > 4)
+- syslog (LOG_DEBUG, "%s: qname offset = %zd", fn, ucp - buf);
++ syslog (LOG_DEBUG, "%s: qname offset = %td", fn, ucp - buf);
+
+ i = dname_copy (qname, ucp, buflen - written_len);
+ if (i < 0)
+@@ -70,7 +70,7 @@
+
+ /* write qtype / qclass */
+ if (T.debug > 4)
+- syslog (LOG_DEBUG, "%s: qtype/qclass offset = %zd",
++ syslog (LOG_DEBUG, "%s: qtype/qclass offset = %td",
+ fn, ucp - buf);
+
+ written_len += sizeof (uint16_t) * 2;
+@@ -226,13 +226,13 @@
+ *cnt = htons (us);
+
+ if (T.debug > 4)
+- syslog (LOG_DEBUG, "%s: now counter = %zd",
++ syslog (LOG_DEBUG, "%s: now counter = %u",
+ fn, us);
+ }
+ }
+
+ if (T.debug > 4)
+- syslog (LOG_DEBUG, "%s: return %d", fn, *wp - wp_start);
++ syslog (LOG_DEBUG, "%s: return %td", fn, *wp - wp_start);
+
+ return (*wp - wp_start);
+ }
diff -uNr totd/files/patch-ne_mesg.c.orig totd/files/patch-ne_mesg.c.orig
--- totd/files/patch-ne_mesg.c.orig Thu Jan 1 01:00:00 1970
+++ totd/files/patch-ne_mesg.c.orig Tue Sep 13 21:00:17 2005
@@ -0,0 +1,29 @@
+--- ne_mesg.c.orig Tue Sep 13 20:54:18 2005
++++ ne_mesg.c Tue Sep 13 20:54:38 2005
+@@ -59,7 +59,7 @@ int mesg_make_query (u_char *qname, uint
+
+ /* write qname */
+ if (T.debug > 4)
+- syslog (LOG_DEBUG, "%s: qname offset = %zd", fn, ucp - buf);
++ syslog (LOG_DEBUG, "%s: qname offset = %td", fn, ucp - buf);
+
+ i = dname_copy (qname, ucp, buflen - written_len);
+ if (i < 0)
+@@ -70,7 +70,7 @@ int mesg_make_query (u_char *qname, uint
+
+ /* write qtype / qclass */
+ if (T.debug > 4)
+- syslog (LOG_DEBUG, "%s: qtype/qclass offset = %zd",
++ syslog (LOG_DEBUG, "%s: qtype/qclass offset = %td",
+ fn, ucp - buf);
+
+ written_len += sizeof (uint16_t) * 2;
+@@ -232,7 +232,7 @@ int mesg_write_rrset_list (G_List *rrls,
+ }
+
+ if (T.debug > 4)
+- syslog (LOG_DEBUG, "%s: return %d", fn, *wp - wp_start);
++ syslog (LOG_DEBUG, "%s: return %td", fn, *wp - wp_start);
+
+ return (*wp - wp_start);
+ }
diff -uNr totd/files/patch-tcp_response.c totd/files/patch-tcp_response.c
--- totd/files/patch-tcp_response.c Thu Jan 1 01:00:00 1970
+++ totd/files/patch-tcp_response.c Tue Sep 13 21:03:07 2005
@@ -0,0 +1,11 @@
+--- tcp_response.c.orig Mon Jul 4 11:09:22 2005
++++ tcp_response.c Tue Sep 13 21:00:53 2005
+@@ -110,7 +110,7 @@
+
+ cont->wp += len;
+ if (cont->wp < (cont->mesg.p + cont->mesg_len)) {
+- syslog (LOG_DEBUG, "%s: left %zd bytes -- continue.", fn,
++ syslog (LOG_DEBUG, "%s: left %td bytes -- continue.", fn,
+ (cont->mesg.p + cont->mesg_len) - cont->wp);
+
+ /* SUCCESS */
diff -uNr totd/files/patch-tcp_response.c.orig totd/files/patch-tcp_response.c.orig
--- totd/files/patch-tcp_response.c.orig Thu Jan 1 01:00:00 1970
+++ totd/files/patch-tcp_response.c.orig Tue Sep 13 21:00:44 2005
@@ -0,0 +1,11 @@
+--- tcp_response.c.orig Tue Sep 13 20:54:54 2005
++++ tcp_response.c Tue Sep 13 20:55:02 2005
+@@ -110,7 +110,7 @@ int tcp_response_reading_process (Contex
+
+ cont->wp += len;
+ if (cont->wp < (cont->mesg.p + cont->mesg_len)) {
+- syslog (LOG_DEBUG, "%s: left %zd bytes -- continue.", fn,
++ syslog (LOG_DEBUG, "%s: left %td bytes -- continue.", fn,
+ (cont->mesg.p + cont->mesg_len) - cont->wp);
+
+ /* SUCCESS */
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list