Ticket #39466: Portfile-pv-final.diff
File Portfile-pv-final.diff, 5.4 KB (added by mark.carver@…, 11 years ago) |
---|
-
Portfile
5 5 PortGroup muniversal 1.0 6 6 7 7 name pv 8 version 1. 3.48 version 1.4.6 9 9 categories sysutils 10 10 platforms darwin 11 maintainers gmail.com:meissnem11 maintainers me.com:mark.carver 12 12 license Apache-2 13 13 14 14 description monitor the progress of data through a pipe … … 25 25 26 26 use_bzip2 yes 27 27 28 checksums rmd160 8fa94f1317f191f3e2138d74b7de2e5ff0a1b0d0\29 sha256 26b031e0a713ee00d956ed75b0c445a8aa614f40289d96f623efc177c1388b8428 checksums rmd160 ecbcc4791acd108bfee09f49280808d1470e37c2 \ 29 sha256 edfea0033ec6222eb60b4ec6d905dd2dccdb5900beef03f67f42ca9ed67e9fe2 30 30 31 31 configure.args --mandir=${prefix}/share/man \ 32 32 --infodir=${prefix}/share/info -
files/stat64.diff
1 --- src/pv/file.c.orig 2012-06-26 04:37:50.000000000 -0500 2 +++ src/pv/file.c 2012-07-21 11:18:47.000000000 -0500 3 @@ -37,27 +37,27 @@ 4 */ 5 void pv_calc_total_size(opts_t opts) 1 --- src/pv/file.c 2013-01-22 17:28:24.000000000 -0600 2 +++ src/pv/file.c 2013-06-19 02:27:43.000000000 -0500 3 @@ -33,7 +33,7 @@ 4 unsigned long long pv_calc_total_size(pvstate_t state) 6 5 { 6 unsigned long long total; 7 7 - struct stat64 sb; 8 8 + struct stat sb; 9 9 int rc, i, j, fd; 10 10 11 opts->size = 0; 12 rc = 0; 13 14 if (opts->argc < 1) { 15 - if (fstat64(STDIN_FILENO, &sb) == 0) 16 + if (fstat(STDIN_FILENO, &sb) == 0) 17 opts->size = sb.st_size; 18 return; 11 total = 0; 12 @@ -43,20 +43,20 @@ 13 * No files specified - check stdin. 14 */ 15 if (state->input_file_count < 1) { 16 - if (0 == fstat64(STDIN_FILENO, &sb)) 17 + if (0 == fstat(STDIN_FILENO, &sb)) 18 total = sb.st_size; 19 return total; 19 20 } 20 21 21 for (i = 0; i < opts->argc; i++) {22 if ( strcmp(opts->argv[i], "-") == 0) {22 for (i = 0; i < state->input_file_count; i++) { 23 if (0 == strcmp(state->input_files[i], "-")) { 23 24 - rc = fstat64(STDIN_FILENO, &sb); 24 25 + rc = fstat(STDIN_FILENO, &sb); 25 26 if (rc != 0) { 26 opts->size= 0;27 return ;27 total = 0; 28 return total; 28 29 } 29 30 } else { 30 - rc = stat64( opts->argv[i], &sb);31 + rc = stat( opts->argv[i], &sb);32 if ( rc == 0)33 rc = access( opts->argv[i], R_OK);31 - rc = stat64(state->input_files[i], &sb); 32 + rc = stat(state->input_files[i], &sb); 33 if (0 == rc) 34 rc = access(state->input_files[i], R_OK); 34 35 } 35 @@ -109,14 +109,14 @@ 36 @@ -112,7 +112,7 @@ 37 * and that we can seek back to the start after getting the size. 38 */ 39 if (total <= 0) { 40 - rc = fstat64(STDOUT_FILENO, &sb); 41 + rc = fstat(STDOUT_FILENO, &sb); 42 if ((0 == rc) && S_ISBLK(sb.st_mode) 43 && (0 == (fcntl(STDOUT_FILENO, F_GETFL) & O_APPEND))) { 44 total = lseek64(STDOUT_FILENO, 0, SEEK_END); 45 @@ -148,14 +148,14 @@ 36 46 fd = -1; 37 47 38 if ( strcmp(opts->argv[i], "-") == 0) {48 if (0 == strcmp(state->input_files[i], "-")) { 39 49 - rc = fstat64(STDIN_FILENO, &sb); 40 50 + rc = fstat(STDIN_FILENO, &sb); 41 51 if ((rc != 0) || (!S_ISREG(sb.st_mode))) { 42 opts->size= 0;43 return ;52 total = 0; 53 return total; 44 54 } 45 55 fd = dup(STDIN_FILENO); 46 56 } else { 47 - rc = stat64( opts->argv[i], &sb);48 + rc = stat( opts->argv[i], &sb);57 - rc = stat64(state->input_files[i], &sb); 58 + rc = stat(state->input_files[i], &sb); 49 59 if ((rc != 0) || (!S_ISREG(sb.st_mode))) { 50 opts->size= 0;51 return ;52 @@ - 167,8 +167,8 @@60 total = 0; 61 return total; 62 @@ -212,8 +212,8 @@ 53 63 */ 54 int pv_next_file( opts_t opts, int filenum, int oldfd)64 int pv_next_file(pvstate_t state, int filenum, int oldfd) 55 65 { 56 66 - struct stat64 isb; 57 67 - struct stat64 osb; 58 68 + struct stat isb; 59 69 + struct stat osb; 60 int fd ;70 int fd, input_file_is_stdout; 61 71 62 72 if (oldfd > 0) { 63 @@ -2 06,7 +206,7 @@73 @@ -252,7 +252,7 @@ 64 74 } 65 75 } 66 76 67 77 - if (fstat64(fd, &isb)) { 68 78 + if (fstat(fd, &isb)) { 69 79 fprintf(stderr, "%s: %s: %s: %s\n", 70 opts->program_name,80 state->program_name, 71 81 _("failed to stat file"), 72 @@ -2 16,7 +216,7 @@82 @@ -262,7 +262,7 @@ 73 83 return -1; 74 84 } 75 85 76 86 - if (fstat64(STDOUT_FILENO, &osb)) { 77 87 + if (fstat(STDOUT_FILENO, &osb)) { 78 88 fprintf(stderr, "%s: %s: %s\n", 79 opts->program_name,89 state->program_name, 80 90 _("failed to stat output file"), strerror(errno)); 81 --- src/pv/loop.c .orig 2012-06-26 04:37:50.000000000 -050082 +++ src/pv/loop.c 201 2-07-21 11:18:47.000000000 -050083 @@ - 63,7 +63,7 @@91 --- src/pv/loop.c 2013-01-22 17:28:24.000000000 -0600 92 +++ src/pv/loop.c 2013-06-19 02:27:43.000000000 -0500 93 @@ -50,7 +50,7 @@ 84 94 struct timeval start_time, next_update, next_ratecheck, cur_time; 85 struct timeval init_time ;95 struct timeval init_time, next_remotecheck; 86 96 long double elapsed; 87 97 - struct stat64 sb; 88 98 + struct stat sb; 89 99 int fd, n; 90 100 91 101 /* 92 @@ -1 11,7 +111,7 @@93 return opts->exit_status;94 }95 96 - if ( fstat64(fd, &sb) == 0) {97 + if ( fstat(fd, &sb) == 0) {98 pv_set_buffer_size(sb.st_blksize * 32, 0);99 }100 102 @@ -105,7 +105,7 @@ 103 * Set target buffer size if the initial file's block size can be 104 * read and we weren't given a target buffer size. 105 */ 106 - if (0 == fstat64(fd, &sb)) { 107 + if (0 == fstat(fd, &sb)) { 108 unsigned long long sz; 109 sz = sb.st_blksize * 32; 110 if (sz > BUFFER_SIZE_MAX)