summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Sivachenko <demon@FreeBSD.org>2008-12-26 14:08:47 +0000
committerDmitry Sivachenko <demon@FreeBSD.org>2008-12-26 14:08:47 +0000
commit838a35a942f25b55a1a657e0c69fa09ad3ca2a26 (patch)
treeaf4a8db8b60f0e498b716c65439d667602086042
parent- Update to 2.7.6 (diff)
1) Consistently use "%08X" instead of "%08lX" for formatting uint32_t
task ID. 2) Consistently use "%d" instead of "%ld" for formatting int32_t values. This results in printing the same (correct) numbers on amd64 as they appear on i386. Use correct type for arguments in uftp.h:logfunc(...). Bump PORTREVISION.
Notes
Notes: svn path=/head/; revision=224803
-rw-r--r--ftp/uftp/Makefile1
-rw-r--r--ftp/uftp/files/patch-uftp.c79
-rw-r--r--ftp/uftp/files/patch-uftp.h11
-rw-r--r--ftp/uftp/files/patch-uftpd.c71
4 files changed, 139 insertions, 23 deletions
diff --git a/ftp/uftp/Makefile b/ftp/uftp/Makefile
index f9b6da60e7ed..2eed314fa175 100644
--- a/ftp/uftp/Makefile
+++ b/ftp/uftp/Makefile
@@ -7,6 +7,7 @@
PORTNAME= uftp
PORTVERSION= 2.6.5
+PORTREVISION= 1
CATEGORIES= ftp
MASTER_SITES= http://www.tcnj.edu/~bush/
DISTNAME= uftp
diff --git a/ftp/uftp/files/patch-uftp.c b/ftp/uftp/files/patch-uftp.c
new file mode 100644
index 000000000000..8004ff3d979d
--- /dev/null
+++ b/ftp/uftp/files/patch-uftp.c
@@ -0,0 +1,79 @@
+--- uftp.c.orig 2008-12-19 03:56:50.000000000 +0300
++++ uftp.c 2008-12-22 18:39:33.000000000 +0300
+@@ -180,7 +180,7 @@ void announce()
+ continue;
+ }
+ if (header->tx_id!=txID) {
+- logfunc(applog,0,0,0,0,"Invalid txID: %08lX, should be %08lX\n",header->tx_id,txID);
++ logfunc(applog,0,0,0,0,"Invalid txID: %08X, should be %08X\n",header->tx_id,txID);
+ abort_msg("Invalid txID",&sin);
+ continue;
+ }
+@@ -361,7 +361,7 @@ int getnaks(int pass, int section)
+ continue;
+ }
+ if (header->tx_id!=txID) {
+- logfunc(applog,0,0,0,0,"Invalid txID: %08lX, should be %08lX\n",header->tx_id,txID);
++ logfunc(applog,0,0,0,0,"Invalid txID: %08X, should be %08X\n",header->tx_id,txID);
+ continue;
+ }
+ if (header->func==ABORT) {
+@@ -411,7 +411,7 @@ int getnaks(int pass, int section)
+ } else if (gotdest[i]==1) {
+ found=-1;
+ } else {
+- logfunc(applog,0,0,0,0,"Got %ld NAKs for pass %ld section %ld from %s\n",header->nak_count,header->pass,header->section_num,destlist[i].name);
++ logfunc(applog,0,0,0,0,"Got %d NAKs for pass %d section %d from %s\n",header->nak_count,header->pass,header->section_num,destlist[i].name);
+ if ((header->pass==pass)&&(header->section_num==section)) {
+ gotdest[i]=1;
+ destlist[i].naks+=header->nak_count;
+@@ -501,8 +501,8 @@ void xfer()
+ } else {
+ weight_time=(int)floor(((double)weight/100)*((double)filesize/(rate/8)/1024));
+ max_time=(weight_time>min_time)?weight_time:min_time;
+- logfunc(applog,0,0,0,0,"Transfer rate: %ld Kbps (%ld KB/s)\n",rate,rate/8);
+- logfunc(applog,0,0,0,0,"Wait between packets: %ld %cs\n",wait,MICRO);
++ logfunc(applog,0,0,0,0,"Transfer rate: %d Kbps (%d KB/s)\n",rate,rate/8);
++ logfunc(applog,0,0,0,0,"Wait between packets: %d %cs\n",wait,MICRO);
+ }
+ logfunc(applog,0,0,0,0,"Maximum file transfer time: %d seconds\n",max_time);
+ aborted=0;
+@@ -576,7 +576,7 @@ void xfer()
+ break;
+ }
+ if (verbose>=2)
+- logfunc(applog,0,0,0,0,"Resending %ld\n",i);
++ logfunc(applog,0,0,0,0,"Resending %d\n",i);
+ if ((offset=lseek_func(file,((f_offset_t)i*BLOCKSIZE)-prev_offset,SEEK_CUR))==-1) {
+ logfunc(applog,0,1,errno,0,"lseek failed for file");
+ continue;
+@@ -584,9 +584,9 @@ void xfer()
+ if (offset!=(f_offset_t)i*BLOCKSIZE) {
+ logfunc(applog,0,0,0,0,"sizeof f_offset_t = %d\n",sizeof(f_offset_t));
+ if (sizeof(f_offset_t)>4)
+- logfunc(applog,0,0,0,0,"block %ld: offset is %s, should be %s\n",i,printll(offset),printll((f_offset_t)i*BLOCKSIZE));
++ logfunc(applog,0,0,0,0,"block %d: offset is %s, should be %s\n",i,printll(offset),printll((f_offset_t)i*BLOCKSIZE));
+ else
+- logfunc(applog,0,0,0,0,"block %ld: offset is %ld, should be %ld\n",i,offset,(f_offset_t)i*BLOCKSIZE);
++ logfunc(applog,0,0,0,0,"block %d: offset is %ld, should be %ld\n",i,offset,(f_offset_t)i*BLOCKSIZE);
+ continue;
+ }
+ if ((numbytes=read(file,data,BLOCKSIZE))==-1) {
+@@ -624,7 +624,7 @@ void xfer()
+ numnaks+=getnaks(header->pass=pass,header->section_num);
+ gettimestamp(w1);
+ logfunc(applog,0,0,0,0,"average wait time = %.2f %cs\n",(count==0)?0:(float)avg/count,MICRO);
+- logfunc(applog,0,0,0,0,"Received %ld distinct NAKs for pass %d\n",numnaks,pass);
++ logfunc(applog,0,0,0,0,"Received %d distinct NAKs for pass %d\n",numnaks,pass);
+ pass++;
+ } while (numnaks);
+ close(file);
+@@ -892,7 +892,7 @@ int main(int argc, char *argv[])
+ logfunc(applog,0,0,0,0,"Bytes: %s Blocks: %d Sections: %d\n",printll(filesize),numblocks,numsections);
+ else
+ logfunc(applog,0,0,0,0,"Bytes: %d Blocks: %d Sections: %d\n",filesize,numblocks,numsections);
+- logfunc(applog,0,0,0,0,"Using private multicast address %s id %08lX\n",inet_ntoa(receive_dest.sin_addr),txID);
++ logfunc(applog,0,0,0,0,"Using private multicast address %s id %08X\n",inet_ntoa(receive_dest.sin_addr),txID);
+ if (rate==-1) {
+ wait=0;
+ } else {
diff --git a/ftp/uftp/files/patch-uftp.h b/ftp/uftp/files/patch-uftp.h
new file mode 100644
index 000000000000..141c24760ca1
--- /dev/null
+++ b/ftp/uftp/files/patch-uftp.h
@@ -0,0 +1,11 @@
+--- uftp.h.orig 2008-12-26 16:59:05.000000000 +0300
++++ uftp.h 2008-12-26 16:59:14.000000000 +0300
+@@ -338,7 +338,7 @@ void info_ntoh(struct fileinfo *info)
+ info->lolargefsize=ntohl(info->lolargefsize);
+ }
+
+-void logfunc(FILE *logf, int32_t id, int newline, int err, int sockerr, char str[], ...)
++void logfunc(FILE *logf, uint32_t id, int newline, int err, int sockerr, char str[], ...)
+ {
+ va_list args;
+
diff --git a/ftp/uftp/files/patch-uftpd.c b/ftp/uftp/files/patch-uftpd.c
index 54fcfcf9a83b..0808ad667833 100644
--- a/ftp/uftp/files/patch-uftpd.c
+++ b/ftp/uftp/files/patch-uftpd.c
@@ -1,23 +1,48 @@
-*** uftpd.c Sun Feb 25 16:55:42 2007
---- uftpd.c Wed Jun 4 14:05:20 2008
-***************
-*** 853,861 ****
- applog=stderr;
- nice(-20);
- for (c=1;c<=17;c++)
-! sigset(c,gotsig);
-! sigset(SIGPIPE,gotpipe);
-! sigset(SIGCHLD,SIG_IGN);
- #endif
- for (c=0;c<MAXLIST;c++)
- id_list[c].txID=0;
---- 853,861 ----
- applog=stderr;
- nice(-20);
- for (c=1;c<=17;c++)
-! signal(c,gotsig);
-! signal(SIGPIPE,gotpipe);
-! signal(SIGCHLD,SIG_IGN);
- #endif
- for (c=0;c<MAXLIST;c++)
- id_list[c].txID=0;
+--- uftpd.c.orig 2008-12-26 16:54:54.000000000 +0300
++++ uftpd.c 2008-12-26 16:55:36.000000000 +0300
+@@ -200,7 +200,7 @@
+ i++;
+ }
+ if (!found) {
+- logfunc(applog,0,1,0,0,"Name not in host list for id %08lX",header->tx_id);
++ logfunc(applog,0,1,0,0,"Name not in host list for id %08X",header->tx_id);
+ return;
+ }
+ }
+@@ -251,11 +251,11 @@
+ t=time(NULL);
+ logfunc(applog,id_list[listindex].txID,0,0,0,"Received request at %s",ctime(&t));
+ if (noname) {
+- logfunc(applog,id_list[listindex].txID,1,0,0,"Request from %s id %08lX",inet_ntoa(id_list[listindex].dest.sin_addr),id_list[listindex].txID);
++ logfunc(applog,id_list[listindex].txID,1,0,0,"Request from %s id %08X",inet_ntoa(id_list[listindex].dest.sin_addr),id_list[listindex].txID);
+ } else if ((hp=gethostbyaddr((char *)&(id_list[listindex].dest.sin_addr),sizeof(struct in_addr),AF_INET))) {
+- logfunc(applog,id_list[listindex].txID,1,0,0,"Request from %s (%s) id %08lX",hp->h_name,inet_ntoa(id_list[listindex].dest.sin_addr),id_list[listindex].txID);
++ logfunc(applog,id_list[listindex].txID,1,0,0,"Request from %s (%s) id %08X",hp->h_name,inet_ntoa(id_list[listindex].dest.sin_addr),id_list[listindex].txID);
+ } else {
+- logfunc(applog,id_list[listindex].txID,1,0,0,"Request from %s id %08lX",inet_ntoa(id_list[listindex].dest.sin_addr),id_list[listindex].txID);
++ logfunc(applog,id_list[listindex].txID,1,0,0,"Request from %s id %08X",inet_ntoa(id_list[listindex].dest.sin_addr),id_list[listindex].txID);
+ }
+ logfunc(applog,id_list[listindex].txID,1,0,0,"Name of file to receive: %s",id_list[listindex].filename);
+ if (sizeof(f_offset_t)>4)
+@@ -644,7 +644,7 @@
+ }
+ } else {
+ if (listindex==-1) {
+- /*logfunc(applog,0,1,0,0,"Invalid txID: %08lX, doesn't match any current file",header->tx_id);*/
++ /*logfunc(applog,0,1,0,0,"Invalid txID: %08X, doesn't match any current file",header->tx_id);*/
+ continue;
+ }
+ switch (id_list[listindex].phase) {
+@@ -867,9 +867,9 @@
+ applog=stderr;
+ nice(-20);
+ for (c=1;c<=17;c++)
+- sigset(c,gotsig);
+- sigset(SIGPIPE,gotpipe);
+- sigset(SIGCHLD,SIG_IGN);
++ signal(c,gotsig);
++ signal(SIGPIPE,gotpipe);
++ signal(SIGCHLD,SIG_IGN);
+ #endif
+ for (c=0;c<MAXLIST;c++)
+ id_list[c].txID=0;