rpms/iputils/devel iputils-gcc41.patch, NONE, 1.1 iputils.spec, 1.31, 1.32

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Wed Jan 25 15:38:26 UTC 2006


Author: rvokal

Update of /cvs/dist/rpms/iputils/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv22943

Modified Files:
	iputils.spec 
Added Files:
	iputils-gcc41.patch 
Log Message:
- gcc patch, warnings cleaned-up

iputils-gcc41.patch:
 arping.c      |    8 ++++----
 clockdiff.c   |   20 +++++++++++++-------
 ifenslave.c   |    2 +-
 ping.c        |   14 ++++++++------
 ping6.c       |   12 +++++++-----
 ping_common.c |   20 +++++++++++---------
 rarpd.c       |   17 ++++++++++++-----
 rdisc.c       |    2 +-
 tftpd.c       |    6 +++---
 traceroute6.c |    4 ++--
 10 files changed, 62 insertions(+), 43 deletions(-)

--- NEW FILE iputils-gcc41.patch ---
--- iputils/ping6.c.gcc41	2006-01-25 16:21:47.000000000 +0100
+++ iputils/ping6.c	2006-01-25 16:21:47.000000000 +0100
@@ -1,4 +1,4 @@
-/*
+/*[21~
  *
  *	Modified for AF_INET6 by Pedro Roque
  *
@@ -383,7 +383,7 @@
 			exit(2);
 		}
 		alen = sizeof(source);
-		if (getsockname(probe_fd, (struct sockaddr*)&source, &alen) == -1) {
+		if (getsockname(probe_fd, (struct sockaddr*)&source, (socklen_t*)&alen) == -1) {
 			perror("getsockname");
 			exit(2);
 		}
@@ -599,6 +599,7 @@
 	int net_errors = 0;
 	int local_errors = 0;
 	int saved_errno = errno;
+	ssize_t wr_ret;
 
 	iov.iov_base = &icmph;
 	iov.iov_len = sizeof(icmph);
@@ -629,7 +630,7 @@
 		if (options & F_QUIET)
 			goto out;
 		if (options & F_FLOOD)
-			write(STDOUT_FILENO, "E", 1);
+			wr_ret = write(STDOUT_FILENO, "E", 1);
 		else if (e->ee_errno != EMSGSIZE)
 			fprintf(stderr, "ping: local error: %s\n", strerror(e->ee_errno));
 		else
@@ -652,7 +653,7 @@
 		if (options & F_QUIET)
 			goto out;
 		if (options & F_FLOOD) {
-			write(STDOUT_FILENO, "\bE", 2);
+			wr_ret = write(STDOUT_FILENO, "\bE", 2);
 		} else {
 			printf("From %s icmp_seq=%u ", pr_addr(&sin6->sin6_addr), ntohs(icmph.icmp6_sequence));
 			pr_icmph(e->ee_type, e->ee_code, e->ee_info);
@@ -795,7 +796,8 @@
 				return 0;
 			nerrors++;
 			if (options & F_FLOOD) {
-				write(STDOUT_FILENO, "\bE", 2);
+				ssize_t wr_ret;
+				wr_ret = write(STDOUT_FILENO, "\bE", 2);
 				return 0;
 			}
 			printf("From %s: icmp_seq=%u ", pr_addr(&from->sin6_addr), ntohs(icmph1->icmp6_sequence));
--- iputils/arping.c.gcc41	2006-01-25 16:21:47.000000000 +0100
+++ iputils/arping.c	2006-01-25 16:21:47.000000000 +0100
@@ -449,7 +449,7 @@
 				perror("connect");
 				exit(2);
 			}
-			if (getsockname(probe_fd, (struct sockaddr*)&saddr, &alen) == -1) {
+			if (getsockname(probe_fd, (struct sockaddr*)&saddr, (socklen_t*)&alen) == -1) {
 				perror("getsockname");
 				exit(2);
 			}
@@ -468,7 +468,7 @@
 
 	if (1) {
 		int alen = sizeof(me);
-		if (getsockname(s, (struct sockaddr*)&me, &alen) == -1) {
+		if (getsockname(s, (struct sockaddr*)&me, (socklen_t*)&alen) == -1) {
 			perror("getsockname");
 			exit(2);
 		}
@@ -499,13 +499,13 @@
 
 	while(1) {
 		sigset_t sset, osset;
-		char packet[4096];
+		unsigned char packet[4096];
 		struct sockaddr_ll from;
 		int alen = sizeof(from);
 		int cc;
 
 		if ((cc = recvfrom(s, packet, sizeof(packet), 0,
-				   (struct sockaddr *)&from, &alen)) < 0) {
+				   (struct sockaddr *)&from, (socklen_t*)&alen)) < 0) {
 			perror("arping: recvfrom");
 			continue;
 		}
--- iputils/traceroute6.c.gcc41	2006-01-25 16:21:47.000000000 +0100
+++ iputils/traceroute6.c	2006-01-25 16:21:47.000000000 +0100
@@ -529,7 +529,7 @@
 			exit(1);
 		}
 		alen = sizeof(saddr);
-		if (getsockname(probe_fd, (struct sockaddr*)&saddr, &alen) == -1) {
+		if (getsockname(probe_fd, (struct sockaddr*)&saddr, (socklen_t*)&alen) == -1) {
 			perror("getsockname");
 			exit(1);
 		}
@@ -656,7 +656,7 @@
 
 	if (select(sock+1, &fds, (fd_set *)0, (fd_set *)0, &wait) > 0) {
 		cc=recvfrom(icmp_sock, (char *)packet, sizeof(packet), 0,
-			    (struct sockaddr *)from, &fromlen);
+			    (struct sockaddr *)from, (socklen_t*)&fromlen);
 	}
 
 	return(cc);
--- iputils/ifenslave.c.gcc41	2004-10-18 10:25:04.000000000 +0200
+++ iputils/ifenslave.c	2006-01-25 16:28:32.000000000 +0100
@@ -1092,7 +1092,7 @@
 			return res;
 		}
 
-		ipaddr = ifr.ifr_addr.sa_data;
+		ipaddr = (unsigned char *)ifr.ifr_addr.sa_data;
 		v_print("Interface '%s': set IP %s to %d.%d.%d.%d\n",
 			slave_ifname, ifra[i].desc,
 			ipaddr[0], ipaddr[1], ipaddr[2], ipaddr[3]);
--- iputils/tftpd.c.gcc41	2006-01-25 16:21:47.000000000 +0100
+++ iputils/tftpd.c	2006-01-25 16:21:47.000000000 +0100
@@ -126,7 +126,7 @@
 	}
 	fromlen = sizeof (from);
 	n = recvfrom(0, buf, sizeof (buf), 0,
-	    (struct sockaddr *)&from, &fromlen);
+	    (struct sockaddr *)&from, (socklen_t*)&fromlen);
 	if (n < 0) {
 		if (errno != EAGAIN)
 			syslog(LOG_ERR, "recvfrom: %m\n");
@@ -164,9 +164,9 @@
 				 * than one tftpd being started up to service
 				 * a single request from a single client.
 				 */
-				j = sizeof from;
+				j = sizeof (from);
 				i = recvfrom(0, buf, sizeof (buf), 0,
-				    (struct sockaddr *)&from, &j);
+				    (struct sockaddr *)&from, (socklen_t*)&j);
 				if (i > 0) {
 					n = i;
 					fromlen = j;
--- iputils/clockdiff.c.gcc41	2006-01-25 16:21:47.000000000 +0100
+++ iputils/clockdiff.c	2006-01-25 16:21:47.000000000 +0100
@@ -148,7 +148,7 @@
 	if (select(FD_SETSIZE, &ready, (fd_set *)0, (fd_set *)0, &tout)) {
 		length = sizeof(struct sockaddr_in);
 		cc = recvfrom(sock_raw, (char *)packet, PACKET_IN, 0, 
-		    (struct sockaddr *)NULL, &length);
+		    (struct sockaddr *)NULL, (socklen_t*)&length);
 		if (cc < 0)
 			return -1;
 		goto empty;
@@ -214,7 +214,7 @@
 
 			(void)gettimeofday(&tv1, (struct timezone *)0);
 			cc = recvfrom(sock_raw, (char *)packet, PACKET_IN, 0, 
-			    (struct sockaddr *)NULL, &length);
+			    (struct sockaddr *)NULL, (socklen_t*)&length);
 
 			if (cc < 0)
 				return(-1);
@@ -326,7 +326,7 @@
 	if (select(FD_SETSIZE, &ready, (fd_set *)0, (fd_set *)0, &tout)) {
 		length = sizeof(struct sockaddr_in);
 		cc = recvfrom(sock_raw, (char *)packet, PACKET_IN, 0, 
-		    (struct sockaddr *)NULL, &length);
+		    (struct sockaddr *)NULL, (socklen_t*)&length);
 		if (cc < 0)
 			return -1;
 		goto empty;
@@ -396,7 +396,7 @@
 
 			(void)gettimeofday(&tv1, (struct timezone *)0);
 			cc = recvfrom(sock_raw, (char *)packet, PACKET_IN, 0, 
-				      (struct sockaddr *)NULL, &length);
+				      (struct sockaddr *)NULL, (socklen_t*)&length);
 
 			if (cc < 0)
 				return(-1);
@@ -539,6 +539,7 @@
 	struct hostent * hp;
 	char hostname[MAXHOSTNAMELEN];
 	int s_errno = 0;
+	int nice_ret;
 
 	if (argc < 2) {
 		setuid(getuid());
@@ -606,7 +607,7 @@
 		rspace[1] = ip_opt_len;
 		rspace[2] = 5;
 		rspace[3] = IPOPT_TS_PRESPEC;
-		if (getsockname(sock_raw, (struct sockaddr*)&myaddr, &addrlen) == -1) {
+		if (getsockname(sock_raw, (struct sockaddr*)&myaddr, (socklen_t*)&addrlen) == -1) {
 			perror("getsockname");
 			exit(1);
 		}
@@ -623,8 +624,13 @@
 			ip_opt_len = 0;
 		}
 	}
-
-	nice(-16);
+	nice_ret = nice(-16);
+	if (nice_ret < 0) {
+		if (errno)
+			perror("nice");
+		else
+			fprintf(stderr, "nice: unknown failure\n");
+	}
 
 	if ((measure_status = (ip_opt_len ? measure_opt : measure)(&server)) < 0) {
 		if (errno)
--- iputils/rdisc.c.gcc41	2006-01-25 16:21:47.000000000 +0100
+++ iputils/rdisc.c	2006-01-25 16:21:47.000000000 +0100
@@ -454,7 +454,7 @@
 		int cc;
 
 		cc=recvfrom(s, (char *)packet, len, 0, 
-			    (struct sockaddr *)&from, &fromlen);
+			    (struct sockaddr *)&from, (socklen_t*)&fromlen);
 		if (cc<0) {
 			if (errno == EINTR)
 				continue;
--- iputils/rarpd.c.gcc41	2001-12-02 19:45:06.000000000 +0100
+++ iputils/rarpd.c	2006-01-25 16:21:47.000000000 +0100
@@ -154,8 +154,8 @@
 			ifl->index = index;
 			ifl->hatype = ifrp->ifr_hwaddr.sa_family;
 			memcpy(ifl->lladdr, ifrp->ifr_hwaddr.sa_data, 14);
-			strncpy(ifl->name, ifrp->ifr_name, IFNAMSIZ);
-			p = strchr(ifl->name, ':');
+			strncpy((char*)ifl->name, ifrp->ifr_name, IFNAMSIZ);
+			p = strchr((char*)ifl->name, ':');
 			if (p)
 				*p = 0;
 			if (verbose)
@@ -423,7 +423,7 @@
 	unsigned char *ptr;
 	int n;
 
-	n = recvfrom(fd, buf, sizeof(buf), MSG_DONTWAIT, (struct sockaddr*)&sll, &sll_len);
+	n = recvfrom(fd, buf, sizeof(buf), MSG_DONTWAIT, (struct sockaddr*)&sll, (socklen_t*)&sll_len);
 	if (n<0) {
 		if (errno != EINTR && errno != EAGAIN)
 			syslog(LOG_ERR, "recvfrom: %m");
@@ -531,7 +531,7 @@
 	/* Update our ARP cache. Probably, this guy
 	   will not able to make ARP (if it is broken)
 	 */
-	arp_advise(sll.sll_ifindex, rmap->lladdr, rmap->lladdr_len, rmap->ipaddr);
+	arp_advise(sll.sll_ifindex,(unsigned char *)rmap->lladdr, rmap->lladdr_len, rmap->ipaddr);
 
 	/* Sendto is blocking, but with 5sec timeout */
 	alarm(5);
@@ -673,8 +673,15 @@
 			perror("rarpd: fork");
 			exit(1);
 		}
+		int chdir_ret = chdir("/");
+		if (chdir_ret != 0) {
+		    if (errno)
+			perror("chdir");
+		    else
+			fprintf(stderr, "chdir: Uknown error\n");
+		}
 
-		chdir("/");
+		
 		fd = open("/dev/null", O_RDWR);
 		if (fd >= 0) {
 			dup2(fd, 0);
--- iputils/ping_common.c.gcc41	2006-01-25 16:21:47.000000000 +0100
+++ iputils/ping_common.c	2006-01-25 16:21:47.000000000 +0100
@@ -67,7 +67,7 @@
 	int ii, jj, kk;
 	int pat[16];
 	char *cp;
-	char *bp = outpack+8;
+	char *bp = (char*)(outpack+8);
 
 	for (cp = patp; *cp; cp++) {
 		if (!isxdigit(*cp)) {
@@ -284,6 +284,7 @@
 	static int oom_count;
 	static int tokens;
 	int i;
+	ssize_t wr_ret;
 
 	/* Have we already sent enough? If we have, return an arbitrary positive value. */ 
 	if (exiting || (npackets && ntransmitted >= npackets && !deadline))
@@ -327,7 +328,7 @@
 			 * high preload or pipe size is very confusing. */
 			if ((preload < screen_width && pipesize < screen_width) ||
 			    in_flight() < screen_width)
-				write(STDOUT_FILENO, ".", 1);
+				wr_ret = write(STDOUT_FILENO, ".", 1);
 		}
 		return interval - tokens;
 	}
@@ -380,7 +381,7 @@
 
 	if (i == 0 && !(options & F_QUIET)) {
 		if (options & F_FLOOD)
-			write(STDOUT_FILENO, "E", 1);
+			wr_ret = write(STDOUT_FILENO, "E", 1);
 		else
 			perror("ping: sendmsg");
 	}
@@ -402,8 +403,8 @@
 	rcvbuf = hold = alloc * preload;
 	if (hold < 65536)
 		hold = 65536;
-	setsockopt(icmp_sock, SOL_SOCKET, SO_RCVBUF, (char *)&hold, sizeof(hold));
-	if (getsockopt(icmp_sock, SOL_SOCKET, SO_RCVBUF, (char *)&hold, &tmplen) == 0) {
+	setsockopt(icmp_sock, SOL_SOCKET, SO_RCVBUF, (char *)&hold, (socklen_t)sizeof(hold));
+	if (getsockopt(icmp_sock, SOL_SOCKET, SO_RCVBUF, (char *)&hold, (socklen_t*)&tmplen) == 0) {
 		if (hold < rcvbuf)
 			fprintf(stderr, "WARNING: probably, rcvbuf is not enough to hold preload.\n");
 	}
@@ -464,7 +465,7 @@
 
 	if (!(options & F_PINGFILLED)) {
 		int i;
-		char *p = outpack+8;
+		char *p = (char*)(outpack+8);
 
 		/* Do not forget about case of small datalen,
 		 * fill timestamp area too!
@@ -650,7 +651,8 @@
 {
 	int dupflag = 0;
 	long triptime = 0;
-
+	ssize_t wr_ret;
+	
 	++nreceived;
 	if (!csfailed)
 		acknowledge(seq);
@@ -706,9 +708,9 @@
 
 	if (options & F_FLOOD) {
 		if (!csfailed)
-			write(STDOUT_FILENO, "\b \b", 3);
+			wr_ret = write(STDOUT_FILENO, "\b \b", 3);
 		else
-			write(STDOUT_FILENO, "\bC", 1);
+			wr_ret = write(STDOUT_FILENO, "\bC", 1);
 	} else {
 		int i;
 		__u8 *cp, *dp;
--- iputils/ping.c.gcc41	2006-01-25 16:21:47.000000000 +0100
+++ iputils/ping.c	2006-01-25 16:21:47.000000000 +0100
@@ -314,7 +314,7 @@
 			}
 		}
 		alen = sizeof(source);
-		if (getsockname(probe_fd, (struct sockaddr*)&source, &alen) == -1) {
+		if (getsockname(probe_fd, (struct sockaddr*)&source, (socklen_t*)&alen) == -1) {
 			perror("getsockname");
 			exit(2);
 		}
@@ -517,6 +517,7 @@
 	int net_errors = 0;
 	int local_errors = 0;
 	int saved_errno = errno;
+	ssize_t wr_ret;
 
 	iov.iov_base = &icmph;
 	iov.iov_len = sizeof(icmph);
@@ -547,7 +548,7 @@
 		if (options & F_QUIET)
 			goto out;
 		if (options & F_FLOOD)
-			write(STDOUT_FILENO, "E", 1);
+			wr_ret = write(STDOUT_FILENO, "E", 1);
 		else if (e->ee_errno != EMSGSIZE)
 			fprintf(stderr, "ping: local error: %s\n", strerror(e->ee_errno));
 		else
@@ -583,7 +584,7 @@
 		if (options & F_QUIET)
 			goto out;
 		if (options & F_FLOOD) {
-			write(STDOUT_FILENO, "\bE", 2);
+			wr_ret = write(STDOUT_FILENO, "\bE", 2);
 		} else {
 			printf("From %s icmp_seq=%u ", pr_addr(sin->sin_addr.s_addr), ntohs(icmph.un.echo.sequence));
 			pr_icmph(e->ee_type, e->ee_code, e->ee_info, NULL);
@@ -677,6 +678,7 @@
 	struct iphdr *ip;
 	int hlen;
 	int csfailed;
+	ssize_t wr_ret;
 
 	/* Check the IP header */
 	ip = (struct iphdr *)buf;
@@ -748,7 +750,7 @@
 					return !error_pkt;
 				if (options & F_FLOOD) {
 					if (error_pkt)
-						write(STDOUT_FILENO, "\bE", 2);
+						wr_ret = write(STDOUT_FILENO, "\bE", 2);
 					return !error_pkt;
 				}
 				printf("From %s: icmp_seq=%u ",
@@ -765,9 +767,9 @@
 		}
 		if ((options & F_FLOOD) && !(options & (F_VERBOSE|F_QUIET))) {
 			if (!csfailed)
-				write(STDOUT_FILENO, "!E", 2);
+				wr_ret = write(STDOUT_FILENO, "!E", 2);
 			else
-				write(STDOUT_FILENO, "!EC", 3);
+				wr_ret = write(STDOUT_FILENO, "!EC", 3);
 			return 0;
 		}
 		if (!(options & F_VERBOSE) || uid)


Index: iputils.spec
===================================================================
RCS file: /cvs/dist/rpms/iputils/devel/iputils.spec,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- iputils.spec	13 Dec 2005 12:39:08 -0000	1.31
+++ iputils.spec	25 Jan 2006 15:38:23 -0000	1.32
@@ -1,7 +1,7 @@
 Summary: Network monitoring tools including ping.
 Name: iputils
 Version: 20020927
-Release: 32
+Release: 33
 License: BSD
 Group: System Environment/Daemons
 Source0: http://www.tux.org/pub/net/ip-routing/%{name}-ss020927.tar.gz
@@ -27,6 +27,7 @@
 Patch17: iputils-flood.patch
 Patch18: iputils-ping-168166.patch
 Patch19: iputils-ipv6-hoplimit.patch
+Patch20: iputils-gcc41.patch
 Prefix: %{_prefix}
 BuildRoot: %{_tmppath}/%{name}-root
 BuildPreReq: docbook-utils perl-SGMLSpm
@@ -61,12 +62,13 @@
 %patch17 -p1 -b .flood
 %patch18 -p1 -b .memset
 %patch19 -p1 -b .hoplimit
+%patch20 -p1 -b .gcc41
 
 %build
 %ifarch s390 s390x
 export CFLAGS="$RPM_OPT_FLAGS -fPIE"
 %else
-export CFLAGS="$RPM_OPT_FLAGS -fpie"
+export CFLAGS="$RPM_OPT_FLAGS -fpie -Werror"
 %endif
 export LDFLAGS="-pie"
 make
@@ -160,6 +162,9 @@
 %config(noreplace) %{_sysconfdir}/rc.d/init.d/rdisc
 
 %changelog
+* Wed Jan 25 2006 Radek Vokál <rvokal at redhat.com> -33
+- gcc patch, warnings cleaned-up
+
 * Tue Dec 13 2005 Radek Vokal <rvokal at redhat.com> 20020927-32
 - fix HOPLIMIT option for setsockopt() (#175471)
 




More information about the fedora-cvs-commits mailing list