rpms/ttcp/devel ttcp-GNU.patch,NONE,1.1 ttcp.spec,1.18,1.19

Marcela Mašláňová (mmaslano) fedora-extras-commits at redhat.com
Thu Feb 14 08:51:19 UTC 2008


Author: mmaslano

Update of /cvs/pkgs/rpms/ttcp/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv25252

Modified Files:
	ttcp.spec 
Added Files:
	ttcp-GNU.patch 
Log Message:
- fix for mass rebuild F-9 alpha
- fix warnings


ttcp-GNU.patch:

--- NEW FILE ttcp-GNU.patch ---
diff -up ttcp-1.12/ttcp.c.gnu ttcp-1.12/ttcp.c
--- ttcp-1.12/ttcp.c.gnu	2008-02-14 09:32:04.000000000 +0100
+++ ttcp-1.12/ttcp.c	2008-02-14 09:47:12.000000000 +0100
@@ -71,6 +71,7 @@ static char RCSid[] = "ttcp.c $Revision:
 static char * useRCSid = ( RCSid + ( (char *)&useRCSid - (char *)&useRCSid ) );
 #endif
 
+#define _GNU_SOURCE
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/time.h>		/* struct timeval */
@@ -94,7 +95,7 @@ struct addrinfo hints, *res, *res0;
 struct ipv6_mreq mreq6;
 struct ip_mreq mreq;
 
-size_t fromlen;
+socklen_t fromlen;
 int fd;				/* fd of network socket */
 
 int buflen = 8 * 1024;		/* length of buffer */
@@ -341,7 +342,7 @@ main(int argc, char **argv)
 	if ((buf = (char *)malloc(buflen+bufalign)) == (char *)NULL)
 		err("malloc");
 	if (bufalign != 0)
-		buf +=(bufalign - ((int)buf % bufalign) + bufoffset) % bufalign;
+		buf +=(bufalign - ((size_t)buf % bufalign) + bufoffset) % bufalign;
 
 	if (trans) {
 		fprintf(stderr, "ttcp-t: buflen=%d, nbuf=%d, align=%d/%d, port=%s",
@@ -470,7 +471,7 @@ main(int argc, char **argv)
 		{ 
 		  struct sockaddr_storage peer;
 		  char addr_buf[NI_MAXHOST];
-		  size_t peerlen = sizeof(peer);
+		  socklen_t peerlen = sizeof(peer);
 		  
 		  if (getpeername(fd, (struct sockaddr*) &peer, &peerlen) < 0)
 			err("getpeername");
@@ -718,7 +719,7 @@ prusage(register struct rusage *r0, regi
 
 		case 'W':
 			i = r1->ru_nswap - r0->ru_nswap;
-			sprintf(outp, "%ld", i);
+			sprintf(outp, "%d", i);
 			END(outp);
 			break;
 
@@ -821,7 +822,7 @@ int
 Nread(int fd, void *buf, int count)
 {
 	struct sockaddr_in from;
-	size_t len = sizeof(from);
+	socklen_t len = sizeof(from);
 	register int cnt;
 	if (udp) {
 		cnt = recvfrom(fd, buf, count, 0, (struct sockaddr *)&from, &len);


Index: ttcp.spec
===================================================================
RCS file: /cvs/pkgs/rpms/ttcp/devel/ttcp.spec,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- ttcp.spec	12 Feb 2008 08:24:23 -0000	1.18
+++ ttcp.spec	14 Feb 2008 08:50:43 -0000	1.19
@@ -8,7 +8,8 @@
 Source2: ftp://ftp.sgi.com/sgi/src/ttcp/README
 Patch0: ttcp-big.patch
 Patch1: ttcp-malloc.patch
-Patch2: ttcp-inet.patch
+Patch2: ttcp-GNU.patch
+BuildRequires: glibc-headers
 Group: Applications/Internet
 License: Public Domain
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -24,7 +25,7 @@
 cp %{SOURCE0} %{SOURCE1} %{SOURCE2} .
 %patch0 -p1 -b .big
 %patch1 -p1 -b .malloc
-%patch2 -p1 -b .inet
+%patch2 -p1 -b .gnu
 chmod 644 *
 
 %build
@@ -48,6 +49,7 @@
 %changelog
 * Tue Feb 12 2008 Marcela Maslanova <mmaslano at redhat.com> - 1.12-17
 - fix for mass rebuild F-9 alpha
+- fix warnings
 
 * Fri Aug 24 2007 Marcela Maslanova <mmaslano at redhat.com> - 1.12-16
 - check license, mass rebuild




More information about the fedora-extras-commits mailing list