rpms/nuttcp/devel nuttcp-5.1.11-happier_gcc.patch, NONE, 1.1 nuttcp.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2
Radek Vokál (rvokal)
fedora-extras-commits at redhat.com
Mon Nov 28 14:26:24 UTC 2005
Author: rvokal
Update of /cvs/extras/rpms/nuttcp/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv29026/devel
Modified Files:
.cvsignore sources
Added Files:
nuttcp-5.1.11-happier_gcc.patch nuttcp.spec
Log Message:
auto-import nuttcp-5.1.11-4 on branch devel from nuttcp-5.1.11-4.src.rpm
nuttcp-5.1.11-happier_gcc.patch:
--- NEW FILE nuttcp-5.1.11-happier_gcc.patch ---
--- nuttcp-5.1.11/nuttcp-v5.1.11.c.old 2004-06-28 00:00:00.000000000 +0200
+++ nuttcp-5.1.11/nuttcp-v5.1.11.c 2005-11-28 13:02:36.000000000 +0100
@@ -250,6 +250,8 @@
#include <sys/types.h>
#include <sys/time.h> /* struct timeval */
#include <stdlib.h>
+#include <unistd.h>
+#include <sys/wait.h>
#ifndef _WIN32
#include <sys/socket.h>
@@ -846,11 +848,11 @@
int cpu_util;
int first_read;
int correction = 0;
- int pollst;
+ int pollst = 0;
int i, j;
char *cp1, *cp2;
char ch;
- int error_num;
+ int error_num = 0;
int save_errno;
struct servent *sp = 0;
struct addrinfo hints, *res = NULL;
@@ -1342,14 +1344,12 @@
}
if (argc >= 1) {
- struct sockaddr_storage dummy;
-
host = argv[0];
bzero(&hints, sizeof(hints));
res = NULL;
if (explicitaf) hints.ai_family = af;
- if (error_num = getaddrinfo(host, NULL, &hints, &res)) {
+ if ((error_num = getaddrinfo(host, NULL, &hints, &res))) {
fprintf(stderr, "bad hostname or address: %s\n", gai_strerror(error_num));
exit(1);
}
@@ -1375,17 +1375,17 @@
if (!port) {
if (af == AF_INET) {
- if (sp = getservbyname( "nuttcp-data", "tcp" ))
+ if ((sp = getservbyname( "nuttcp-data", "tcp" )))
port = ntohs(sp->s_port);
else
port = DEFAULT_PORT;
}
#ifdef AF_INET6
else if (af == AF_INET6) {
- if (sp = getservbyname( "nuttcp6-data", "tcp" ))
+ if ((sp = getservbyname( "nuttcp6-data", "tcp" )))
port = ntohs(sp->s_port);
else {
- if (sp = getservbyname( "nuttcp-data", "tcp" ))
+ if ((sp = getservbyname( "nuttcp-data", "tcp" )))
port = ntohs(sp->s_port);
else
port = DEFAULT_PORT;
@@ -1399,17 +1399,17 @@
if (!ctlport) {
if (af == AF_INET) {
- if (sp = getservbyname( "nuttcp", "tcp" ))
+ if ((sp = getservbyname( "nuttcp", "tcp" )))
ctlport = ntohs(sp->s_port);
else
ctlport = DEFAULT_CTLPORT;
}
#ifdef AF_INET6
else if (af == AF_INET6) {
- if (sp = getservbyname( "nuttcp6", "tcp" ))
+ if ((sp = getservbyname( "nuttcp6", "tcp" )))
ctlport = ntohs(sp->s_port);
else {
- if (sp = getservbyname( "nuttcp", "tcp" ))
+ if ((sp = getservbyname( "nuttcp", "tcp" )))
ctlport = ntohs(sp->s_port);
else
ctlport = DEFAULT_CTLPORT;
@@ -1553,12 +1553,12 @@
nbuf_bytes = 0;
}
- if (udp && interval)
+ if (udp && interval) {
if (buflen >= 32)
udplossinfo = 1;
else
fprintf(stderr, "Unable to print interval loss information if UDP buflen < 32\n");
-
+ }
ivers = vers_major*10000 + vers_minor*100 + vers_delta;
mallocsize = buflen;
@@ -1581,7 +1581,7 @@
if (!(ctlconn = fdopen(fd[0], "w")))
err("fdopen: ctlconn for writing");
close(0);
- dup(fd[0]);
+ dup(fd[0]);
if (srvr_helo) {
fprintf(ctlconn,
HELO_FMT, vers_major,
@@ -3703,13 +3703,13 @@
case 'U':
tvsub(&tdiff, &r1->ru_utime, &r0->ru_utime);
- sprintf(outp,"%d.%01d", tdiff.tv_sec, tdiff.tv_usec/100000);
+ sprintf(outp,"%ld.%01ld", tdiff.tv_sec, tdiff.tv_usec/100000);
END(outp);
break;
case 'S':
tvsub(&tdiff, &r1->ru_stime, &r0->ru_stime);
- sprintf(outp,"%d.%01d", tdiff.tv_sec, tdiff.tv_usec/100000);
+ sprintf(outp,"%ld.%01ld", tdiff.tv_sec, tdiff.tv_usec/100000);
END(outp);
break;
@@ -3730,49 +3730,49 @@
break;
case 'X':
- sprintf(outp,"%d", t == 0 ? 0 : (r1->ru_ixrss-r0->ru_ixrss)/t);
+ sprintf(outp,"%ld", t == 0 ? 0 : (r1->ru_ixrss-r0->ru_ixrss)/t);
END(outp);
break;
case 'D':
- sprintf(outp,"%d", t == 0 ? 0 :
+ sprintf(outp,"%ld", t == 0 ? 0 :
(r1->ru_idrss+r1->ru_isrss-(r0->ru_idrss+r0->ru_isrss))/t);
END(outp);
break;
case 'K':
- sprintf(outp,"%d", t == 0 ? 0 :
+ sprintf(outp,"%ld", t == 0 ? 0 :
((r1->ru_ixrss+r1->ru_isrss+r1->ru_idrss) -
(r0->ru_ixrss+r0->ru_idrss+r0->ru_isrss))/t);
END(outp);
break;
case 'M':
- sprintf(outp,"%d", r1->ru_maxrss/2);
+ sprintf(outp,"%ld", r1->ru_maxrss/2);
END(outp);
break;
case 'F':
- sprintf(outp,"%d", r1->ru_majflt-r0->ru_majflt);
+ sprintf(outp,"%ld", r1->ru_majflt-r0->ru_majflt);
END(outp);
break;
case 'R':
- sprintf(outp,"%d", r1->ru_minflt-r0->ru_minflt);
+ sprintf(outp,"%ld", r1->ru_minflt-r0->ru_minflt);
END(outp);
break;
case 'I':
- sprintf(outp,"%d", r1->ru_inblock-r0->ru_inblock);
+ sprintf(outp,"%ld", r1->ru_inblock-r0->ru_inblock);
END(outp);
break;
case 'O':
- sprintf(outp,"%d", r1->ru_oublock-r0->ru_oublock);
+ sprintf(outp,"%ld", r1->ru_oublock-r0->ru_oublock);
END(outp);
break;
case 'C':
- sprintf(outp,"%d+%d", r1->ru_nvcsw-r0->ru_nvcsw,
+ sprintf(outp,"%ld+%ld", r1->ru_nvcsw-r0->ru_nvcsw,
r1->ru_nivcsw-r0->ru_nivcsw );
END(outp);
break;
@@ -3854,7 +3854,7 @@
{
struct timeval timedol;
struct timeval td;
- register int cnt;
+ register int cnt = 0;
if (irate) {
while (((double)count/realt/125 > rate) && !intr) {
--- NEW FILE nuttcp.spec ---
Name: nuttcp
Version: 5.1.11
Release: 4
# upstream doesn't provide a tarball
Source0: %{name}-%{version}.tar.bz2
URL: ftp://ftp.lcp.nrl.navy.mil/pub/nuttcp/
Patch0: nuttcp-5.1.11-happier_gcc.patch
Summary: Tool for testing TCP connections
Group: Applications/Internet
License: Public Domain
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%description
nuttcp is a network performance measurement tool intended for use by
network and system managers. Its most basic usage is to determine the
raw TCP (or UDP) network layer throughput by transferring memory buffers
from a source system across an interconnecting network to a destination
system, either transferring data for a specified time interval, or
alternatively transferring a specified number of buffers. In addition
to reporting the achieved network throughput in Mbps, nuttcp also
provides additional useful information related to the data transfer
such as user, system, and wall-clock time, transmitter and receiver
CPU utilization, and loss percentage (for UDP transfers).
%prep
%setup -q
%patch0 -p1
sed -i -e "s,/usr/local/bin,%{_bindir},g;" \
-e "s,disable\(.*\)no,disable\t\t= yes,g" xinetd.d/*
%build
# no smp flags required; only one source file
OPT="$RPM_OPT_FLAGS" make
%install
rm -fr $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT{%{_mandir}/man8,%{_bindir},%{_sysconfdir}/xinetd.d}
install -m755 %{name}-v%{version} $RPM_BUILD_ROOT%{_bindir}/%{name}
install -pm644 %{name}.8 $RPM_BUILD_ROOT%{_mandir}/man8
install -pm644 xinetd.d/%{name} $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.d/
%clean
rm -fr $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%doc README examples.txt nuttcp.html xinetd.d/nuttcp4 xinetd.d/nuttcp6
%{_bindir}/%{name}
%{_mandir}/man8/*
%config(noreplace) %{_sysconfdir}/xinetd.d/%{name}
%changelog
* Mon Nov 28 2005 Radek Vokal <rvokal at redhat.com> - 5.1.11-4
- remove debuglist files from tarball
- make gcc happier, warnings clean-up
* Tue Nov 22 2005 Radek Vokal <rvokal at redhat.com> - 5.1.11-3
- spec file clean up by Adrian Reber <adrian at lisas.de>
- added a URL
- removed wrong URL from Source
- fixed summary according to guidlines
- removed bogus build require
- disabled xinetd services
- using correct path in xinetd files
- removed unnecessary checks for BUILD_ROOT
- replaced /etc with macro
- added noreplace flag to %config
* Mon Nov 21 2005 Radek Vokal <rvokal at redhat.com> - 5.1.11-2
- add xinetd.d service
- removed some unnecessary files from tarball
* Mon Nov 21 2005 Radek Vokal <rvokal at redhat.com> - 5.1.11-1
- initial built
Index: .cvsignore
===================================================================
RCS file: /cvs/extras/rpms/nuttcp/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore 28 Nov 2005 14:25:18 -0000 1.1
+++ .cvsignore 28 Nov 2005 14:26:22 -0000 1.2
@@ -0,0 +1 @@
+nuttcp-5.1.11.tar.bz2
Index: sources
===================================================================
RCS file: /cvs/extras/rpms/nuttcp/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources 28 Nov 2005 14:25:18 -0000 1.1
+++ sources 28 Nov 2005 14:26:22 -0000 1.2
@@ -0,0 +1 @@
+ff92552360d74d788a4ece0db2021297 nuttcp-5.1.11.tar.bz2
More information about the fedora-extras-commits
mailing list