source:
npl/system/netkit-ftp/patches/08-netkit-ftp-0.17-longint.patch
@
a2d969e
Last change on this file since a2d969e was c5c522c, checked in by , 8 years ago | |
---|---|
|
|
File size: 4.3 KB |
-
netkit-ftp-0.17/ftp/ftp.c
old new 139 139 static char *gunique(char *); 140 140 static void proxtrans(const char *cmd, char *local, char *remote); 141 141 static int initconn(void); 142 static void ptransfer(const char *direction, long bytes,142 static void ptransfer(const char *direction, long long bytes, 143 143 const struct timeval *t0, 144 144 const struct timeval *t1); 145 145 static void tvsub(struct timeval *tdiff, … … 579 579 int (*volatile closefunc)(FILE *); 580 580 void (*volatile oldintr)(int); 581 581 void (*volatile oldintp)(int); 582 volatile long bytes = 0, hashbytes = HASHBYTES;582 volatile long long bytes = 0, hashbytes = HASHBYTES; 583 583 char buf[BUFSIZ], *bufp; 584 584 const char *volatile lmode; 585 585 … … 713 713 if ((d = write(fileno(dout), bufp, c)) <= 0) 714 714 break; 715 715 if (hash) { 716 while (bytes >= hashbytes) { 717 (void) putchar('#'); 718 hashbytes += HASHBYTES; 719 } 720 (void) fflush(stdout); 721 } 716 while (bytes >= hashbytes) { /* <-- 'long long' signed overflow is */ 717 (void) putchar('#'); /* possible. In this case, we can */ 718 hashbytes += HASHBYTES; /* 'cycle' there for very long time. */ 719 } /* Search 'hasbytes' in file down, */ 720 (void) fflush(stdout); /* there are similar parts. */ 721 } /* <praszyk@redhat.com> */ 722 722 if (tick && (bytes >= hashbytes)) { 723 printf("\rBytes transferred: %l d", bytes);723 printf("\rBytes transferred: %lld", bytes); 724 724 (void) fflush(stdout); 725 725 while (bytes >= hashbytes) 726 726 hashbytes += TICKBYTES; … … 733 733 (void) fflush(stdout); 734 734 } 735 735 if (tick) { 736 (void) printf("\rBytes transferred: %l d\n", bytes);736 (void) printf("\rBytes transferred: %lld\n", bytes); 737 737 (void) fflush(stdout); 738 738 } 739 739 if (c < 0) … … 755 755 hashbytes += HASHBYTES; 756 756 } 757 757 if (tick && (bytes >= hashbytes)) { 758 (void) printf("\rBytes transferred: %l d",758 (void) printf("\rBytes transferred: %lld", 759 759 bytes); 760 760 (void) fflush(stdout); 761 761 while (bytes >= hashbytes) … … 780 780 (void) fflush(stdout); 781 781 } 782 782 if (tick) { 783 (void) printf("\rBytes transferred: %l d\n", bytes);783 (void) printf("\rBytes transferred: %lld\n", bytes); 784 784 (void) fflush(stdout); 785 785 } 786 786 if (ferror(fin)) … … 853 853 void (*volatile oldintp)(int); 854 854 void (*volatile oldintr)(int); 855 855 volatile int is_retr, tcrflag, bare_lfs = 0; 856 static unsigned bufsize ;856 static unsigned bufsize=0; 857 857 static char *buf; 858 volatile long bytes = 0, hashbytes = HASHBYTES;858 volatile long long bytes = 0, hashbytes = HASHBYTES; 859 859 register int c, d; 860 860 struct timeval start, stop; 861 861 struct stat st; … … 1031 1031 (void) fflush(stdout); 1032 1032 } 1033 1033 if (tick && (bytes >= hashbytes) && is_retr) { 1034 (void) printf("\rBytes transferred: %l d",1034 (void) printf("\rBytes transferred: %lld", 1035 1035 bytes); 1036 1036 (void) fflush(stdout); 1037 1037 while (bytes >= hashbytes) … … 1045 1045 (void) fflush(stdout); 1046 1046 } 1047 1047 if (tick && is_retr) { 1048 (void) printf("\rBytes transferred: %l d\n", bytes);1048 (void) printf("\rBytes transferred: %lld\n", bytes); 1049 1049 (void) fflush(stdout); 1050 1050 } 1051 1051 if (c < 0) { … … 1095 1095 hashbytes += HASHBYTES; 1096 1096 } 1097 1097 if (tick && (bytes >= hashbytes) && is_retr) { 1098 printf("\rBytes transferred: %l d",1098 printf("\rBytes transferred: %lld", 1099 1099 bytes); 1100 1100 fflush(stdout); 1101 1101 while (bytes >= hashbytes) … … 1126 1126 (void) fflush(stdout); 1127 1127 } 1128 1128 if (tick && is_retr) { 1129 (void) printf("\rBytes transferred: %l d\n", bytes);1129 (void) printf("\rBytes transferred: %lld\n", bytes); 1130 1130 (void) fflush(stdout); 1131 1131 } 1132 1132 if (bare_lfs) { … … 1540 1540 } 1541 1541 1542 1542 static void 1543 ptransfer(const char *direction, long bytes,1543 ptransfer(const char *direction, long long bytes, 1544 1544 const struct timeval *t0, 1545 1545 const struct timeval *t1) 1546 1546 { … … 1552 1552 s = td.tv_sec + (td.tv_usec / 1000000.); 1553 1553 #define nz(x) ((x) == 0 ? 1 : (x)) 1554 1554 bs = bytes / nz(s); 1555 printf("%l d bytes %s in %.3g secs (%.2g Kbytes/sec)\n",1555 printf("%lld bytes %s in %.3g secs (%.2g Kbytes/sec)\n", 1556 1556 bytes, direction, s, bs / 1024.0); 1557 1557 } 1558 1558 }
Note: See TracBrowser
for help on using the repository browser.