Remove references to 64-bit file functions - stat, lstat, lseek, etc - as part of large file support rewrite.
This commit is contained in:
@@ -233,8 +233,8 @@ struct pvwatchfd_s {
|
||||
#endif
|
||||
char file_fdpath[4096]; /* path to file that was opened */
|
||||
char display_name[512]; /* name to show on progress bar */
|
||||
struct stat64 sb_fd; /* stat of fd symlink */
|
||||
struct stat64 sb_fd_link; /* lstat of fd symlink */
|
||||
struct stat sb_fd; /* stat of fd symlink */
|
||||
struct stat sb_fd_link; /* lstat of fd symlink */
|
||||
unsigned long long size; /* size of whole file, 0 if unknown */
|
||||
long long position; /* position last seen at */
|
||||
struct timeval start_time; /* time we started watching the fd */
|
||||
|
||||
+2
-2
@@ -276,12 +276,12 @@ opts_t opts_parse(int argc, char **argv)
|
||||
/* Permit "@<filename>" as well as just a number. */
|
||||
if ('@' == *optarg) {
|
||||
const char *size_file = 1 + optarg;
|
||||
struct stat64 sb;
|
||||
struct stat sb;
|
||||
int rc;
|
||||
|
||||
rc = 0;
|
||||
memset(&sb, 0, sizeof(sb));
|
||||
rc = stat64(size_file, &sb);
|
||||
rc = stat(size_file, &sb);
|
||||
if (0 == rc) {
|
||||
opts->size = sb.st_size;
|
||||
} else {
|
||||
|
||||
+148
-153
@@ -8,7 +8,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2023-07-17 21:52+0100\n"
|
||||
"POT-Creation-Date: 2023-07-22 19:49+0100\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@@ -16,436 +16,431 @@ msgstr ""
|
||||
"Content-Type: text/plain; charset=CHARSET\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: src/pv/cursor.c:80
|
||||
#: src/pv/cursor.c:86
|
||||
msgid "failed to get terminal name"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/cursor.c:125
|
||||
#: src/pv/cursor.c:131
|
||||
msgid "failed to open lock file"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/cursor.c:159
|
||||
#: src/pv/cursor.c:165
|
||||
msgid "lock attempt failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/cursor.c:409
|
||||
#: src/pv/cursor.c:415
|
||||
msgid "failed to open terminal"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/file.c:119
|
||||
#: src/pv/file.c:125
|
||||
msgid "failed to seek to start of output"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/file.c:215
|
||||
#: src/pv/file.c:221
|
||||
msgid "failed to close file"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/file.c:238
|
||||
#: src/pv/file.c:244
|
||||
msgid "failed to read file"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/file.c:248 src/main/options.c:288
|
||||
#: src/pv/file.c:254 src/main/options.c:290
|
||||
msgid "failed to stat file"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/file.c:257
|
||||
#: src/pv/file.c:263
|
||||
msgid "failed to stat output file"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/file.c:280
|
||||
#: src/pv/file.c:286
|
||||
msgid "input file is output file"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/loop.c:527 src/pv/loop.c:597 src/pv/loop.c:649 src/pv/watchpid.c:68
|
||||
#: src/pv/watchpid.c:79 src/pv/watchpid.c:93 src/pv/watchpid.c:104
|
||||
#: src/pv/watchpid.c:145 src/pv/watchpid.c:168 src/pv/watchpid.c:178
|
||||
#: src/pv/watchpid.c:192 src/pv/watchpid.c:285 src/pv/watchpid.c:294
|
||||
#: src/pv/watchpid.c:332 src/pv/watchpid.c:349
|
||||
msgid "pid"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:341
|
||||
#: src/pv/transfer.c:347
|
||||
msgid "read failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:359
|
||||
#: src/pv/transfer.c:365
|
||||
msgid "warning: read errors detected"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:374
|
||||
#: src/pv/transfer.c:380
|
||||
msgid "file is not seekable"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:437
|
||||
#: src/pv/transfer.c:443
|
||||
msgid "failed to seek past error"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:456
|
||||
#: src/pv/transfer.c:462
|
||||
msgid "skipped past read error"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:458 src/pv/display.c:687
|
||||
#: src/pv/transfer.c:464 src/pv/display.c:699
|
||||
msgid "B"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:631
|
||||
#: src/pv/transfer.c:637
|
||||
msgid "write failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:679 src/pv/display.c:618
|
||||
#: src/pv/transfer.c:685 src/pv/display.c:630
|
||||
msgid "buffer allocation failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:770
|
||||
#: src/pv/transfer.c:776
|
||||
msgid "select call failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/state.c:25
|
||||
msgid "history structure allocation failed"
|
||||
#: src/pv/watchpid.c:74 src/pv/watchpid.c:85 src/pv/watchpid.c:99
|
||||
#: src/pv/watchpid.c:110 src/pv/watchpid.c:151 src/pv/watchpid.c:174
|
||||
#: src/pv/watchpid.c:184 src/pv/watchpid.c:198 src/pv/watchpid.c:291
|
||||
#: src/pv/watchpid.c:300 src/pv/watchpid.c:338 src/pv/watchpid.c:355
|
||||
#: src/pv/loop.c:533 src/pv/loop.c:605 src/pv/loop.c:657
|
||||
msgid "pid"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/state.c:55
|
||||
msgid "none"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/display.c:151
|
||||
msgid "yzafpnum kMGTPEZY"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/display.c:156
|
||||
msgid "yzafpnum KMGTPEZY"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/display.c:683
|
||||
msgid "b"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/display.c:738 src/pv/display.c:752
|
||||
msgid "b/s"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/display.c:742 src/pv/display.c:757
|
||||
msgid "/s"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/display.c:742 src/pv/display.c:758
|
||||
msgid "B/s"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/display.c:793 src/pv/display.c:798 src/pv/display.c:860
|
||||
msgid "ETA"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/watchpid.c:81 src/pv/watchpid.c:95 src/pv/watchpid.c:106
|
||||
#: src/pv/watchpid.c:170 src/pv/watchpid.c:180 src/pv/watchpid.c:194
|
||||
#: src/pv/watchpid.c:87 src/pv/watchpid.c:101 src/pv/watchpid.c:112
|
||||
#: src/pv/watchpid.c:176 src/pv/watchpid.c:186 src/pv/watchpid.c:200
|
||||
msgid "fd"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/watchpid.c:109 src/pv/watchpid.c:197
|
||||
#: src/pv/watchpid.c:115 src/pv/watchpid.c:203
|
||||
msgid "not a regular file or block device"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/version.c:17
|
||||
#, c-format
|
||||
msgid "%s %s - Copyright %s %s"
|
||||
#: src/pv/state.c:31
|
||||
msgid "history structure allocation failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/version.c:20
|
||||
#, c-format
|
||||
msgid "Web site: %s"
|
||||
#: src/pv/state.c:61
|
||||
msgid "none"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/display.c:163
|
||||
msgid "yzafpnum kMGTPEZY"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/display.c:168
|
||||
msgid "yzafpnum KMGTPEZY"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/display.c:695
|
||||
msgid "b"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/display.c:750 src/pv/display.c:764
|
||||
msgid "b/s"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/display.c:754 src/pv/display.c:769
|
||||
msgid "/s"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/display.c:754 src/pv/display.c:770
|
||||
msgid "B/s"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/display.c:805 src/pv/display.c:810 src/pv/display.c:872
|
||||
msgid "ETA"
|
||||
msgstr ""
|
||||
|
||||
#. GNU standard license line and free software notice
|
||||
#: src/main/version.c:23
|
||||
msgid ""
|
||||
"This program is free software, and is being distributed under the\n"
|
||||
"terms of the Artistic License 2.0."
|
||||
msgid "License: Artistic v2.0 <https://opensource.org/license/artistic-2-0/>"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/version.c:28
|
||||
msgid ""
|
||||
"This program is distributed in the hope that it will be useful,\n"
|
||||
"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
|
||||
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
||||
#: src/main/version.c:24
|
||||
msgid "This is free software: you are free to change and redistribute it."
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:31
|
||||
#: src/main/version.c:25
|
||||
msgid "There is NO WARRANTY, to the extent permitted by law."
|
||||
msgstr ""
|
||||
|
||||
#. Project web site link
|
||||
#: src/main/version.c:27
|
||||
msgid "Project web site"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/remote.c:223
|
||||
msgid "message not received"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/remote.c:330
|
||||
msgid "IPC not supported on this system"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:30
|
||||
msgid "show progress bar"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:33
|
||||
#: src/main/help.c:32
|
||||
msgid "show elapsed time"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:35
|
||||
#: src/main/help.c:34
|
||||
msgid "show estimated time of arrival (completion)"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:38
|
||||
#: src/main/help.c:37
|
||||
msgid "show absolute estimated time of arrival (completion)"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:40
|
||||
#: src/main/help.c:39
|
||||
msgid "show data transfer rate counter"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:42
|
||||
#: src/main/help.c:41
|
||||
msgid "show data transfer average rate counter"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:43 src/main/help.c:63 src/main/help.c:71
|
||||
#: src/main/help.c:42 src/main/help.c:62 src/main/help.c:70
|
||||
msgid "SEC"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:45
|
||||
#: src/main/help.c:44
|
||||
msgid "compute average rate over past SEC seconds (default 30s)"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:47
|
||||
#: src/main/help.c:46
|
||||
msgid "show number of bytes transferred"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:49
|
||||
#: src/main/help.c:48
|
||||
msgid "show number of bits transferred"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:51
|
||||
#: src/main/help.c:50
|
||||
msgid "show percentage of transfer buffer in use"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:52
|
||||
#: src/main/help.c:51
|
||||
msgid "NUM"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:53
|
||||
#: src/main/help.c:52
|
||||
msgid "show NUM bytes last written"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:54
|
||||
#: src/main/help.c:53
|
||||
msgid "FORMAT"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:55
|
||||
#: src/main/help.c:54
|
||||
msgid "set output format to FORMAT"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:57
|
||||
#: src/main/help.c:56
|
||||
msgid "output percentages, not visual information"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:59
|
||||
#: src/main/help.c:58
|
||||
msgid "do not output any transfer information at all"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:62
|
||||
#: src/main/help.c:61
|
||||
msgid "display nothing until first byte transferred"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:64
|
||||
#: src/main/help.c:63
|
||||
msgid "display nothing until SEC seconds have passed"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:65
|
||||
#: src/main/help.c:64
|
||||
msgid "SIZE"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:66
|
||||
#: src/main/help.c:65
|
||||
msgid "set estimated data size to SIZE bytes"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:68
|
||||
#: src/main/help.c:67
|
||||
msgid "count lines instead of bytes"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:70
|
||||
#: src/main/help.c:69
|
||||
msgid "lines are null-terminated"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:72
|
||||
#: src/main/help.c:71
|
||||
msgid "update every SEC seconds"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:73
|
||||
#: src/main/help.c:72
|
||||
msgid "WIDTH"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:74
|
||||
#: src/main/help.c:73
|
||||
msgid "assume terminal is WIDTH characters wide"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:75
|
||||
#: src/main/help.c:74
|
||||
msgid "HEIGHT"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:76
|
||||
#: src/main/help.c:75
|
||||
msgid "assume terminal is HEIGHT rows high"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:77
|
||||
#: src/main/help.c:76
|
||||
msgid "NAME"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:78
|
||||
#: src/main/help.c:77
|
||||
msgid "prefix visual information with NAME"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:80
|
||||
#: src/main/help.c:79
|
||||
msgid "output even if standard error is not a terminal"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:82
|
||||
#: src/main/help.c:81
|
||||
msgid "use cursor positioning escape sequences"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:84
|
||||
#: src/main/help.c:83
|
||||
msgid "RATE"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:85
|
||||
#: src/main/help.c:84
|
||||
msgid "limit transfer to RATE bytes per second"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:86
|
||||
#: src/main/help.c:85
|
||||
msgid "BYTES"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:87
|
||||
#: src/main/help.c:86
|
||||
msgid "use a buffer size of BYTES"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:89
|
||||
#: src/main/help.c:88
|
||||
msgid "never use splice(), always use read/write"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:91
|
||||
#: src/main/help.c:90
|
||||
msgid "skip read errors in input"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:93
|
||||
#: src/main/help.c:92
|
||||
msgid "stop after --size bytes have been transferred"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:95
|
||||
#: src/main/help.c:94
|
||||
msgid "PID"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:96
|
||||
#: src/main/help.c:95
|
||||
msgid "update settings of process PID"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:99
|
||||
#: src/main/help.c:98
|
||||
msgid "FILE"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:100
|
||||
#: src/main/help.c:99
|
||||
msgid "save process ID in FILE"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:102
|
||||
#: src/main/help.c:101
|
||||
msgid "PID[:FD]"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:103
|
||||
#: src/main/help.c:102
|
||||
msgid "watch file FD opened by process PID"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:106
|
||||
#: src/main/help.c:105
|
||||
msgid "show this help and exit"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:108
|
||||
#: src/main/help.c:107
|
||||
msgid "show version information and exit"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:114
|
||||
#: src/main/help.c:113
|
||||
#, c-format
|
||||
msgid "Usage: %s [OPTION] [FILE]..."
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:117
|
||||
#: src/main/help.c:116
|
||||
msgid ""
|
||||
"Concatenate FILE(s), or standard input, to standard output,\n"
|
||||
"with monitoring."
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:212
|
||||
#: src/main/help.c:211
|
||||
msgid ""
|
||||
"Debugging is enabled; export the DEBUG environment variable to define the\n"
|
||||
"output filename.\n"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:216
|
||||
#: src/main/help.c:215
|
||||
#, c-format
|
||||
msgid "Please report any bugs to %s."
|
||||
msgstr ""
|
||||
|
||||
#: src/main/main.c:74
|
||||
#: src/main/main.c:76
|
||||
msgid "state allocation failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/main.c:248
|
||||
#: src/main/main.c:250
|
||||
msgid "failed to read terminal attributes"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/remote.c:221
|
||||
msgid "message not received"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/remote.c:328
|
||||
msgid "IPC not supported on this system"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:102
|
||||
#: src/main/options.c:104
|
||||
msgid "option structure allocation failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:116
|
||||
#: src/main/options.c:118
|
||||
msgid "option structure argv allocation failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:160
|
||||
#: src/main/options.c:162
|
||||
msgid "integer argument expected"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:171
|
||||
#: src/main/options.c:173
|
||||
msgid "numeric argument expected"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:182
|
||||
#: src/main/options.c:184
|
||||
msgid "process ID or pid:fd pair expected"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:189
|
||||
#: src/main/options.c:191
|
||||
msgid "invalid process ID"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:355
|
||||
#: src/main/options.c:357
|
||||
#, c-format
|
||||
msgid "Try `%s --help' for more information."
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:359
|
||||
#: src/main/options.c:361
|
||||
#, c-format
|
||||
msgid "Try `%s -h' for more information."
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:375
|
||||
#: src/main/options.c:377
|
||||
msgid ""
|
||||
"cannot use line mode or transfer modifier options when watching file "
|
||||
"descriptors"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:383
|
||||
#: src/main/options.c:385
|
||||
msgid "cannot use cursor positioning when watching file descriptors"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:391
|
||||
#: src/main/options.c:393
|
||||
msgid "cannot use remote control when watching file descriptors"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:399
|
||||
#: src/main/options.c:401
|
||||
msgid "cannot transfer files when watching file descriptors"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:407
|
||||
#: src/main/options.c:409
|
||||
msgid "not available on systems without /proc/self/fdinfo"
|
||||
msgstr ""
|
||||
|
||||
+19
-19
@@ -37,7 +37,7 @@
|
||||
unsigned long long pv_calc_total_size(pvstate_t state)
|
||||
{
|
||||
unsigned long long total;
|
||||
struct stat64 sb;
|
||||
struct stat sb;
|
||||
int rc, i, j, fd;
|
||||
|
||||
total = 0;
|
||||
@@ -48,20 +48,20 @@ unsigned long long pv_calc_total_size(pvstate_t state)
|
||||
* No files specified - check stdin.
|
||||
*/
|
||||
if (state->input_file_count < 1) {
|
||||
if (0 == fstat64(STDIN_FILENO, &sb))
|
||||
if (0 == fstat(STDIN_FILENO, &sb))
|
||||
total = sb.st_size;
|
||||
return total;
|
||||
}
|
||||
|
||||
for (i = 0; i < state->input_file_count; i++) {
|
||||
if (0 == strcmp(state->input_files[i], "-")) {
|
||||
rc = fstat64(STDIN_FILENO, &sb);
|
||||
rc = fstat(STDIN_FILENO, &sb);
|
||||
if (rc != 0) {
|
||||
total = 0;
|
||||
return total;
|
||||
}
|
||||
} else {
|
||||
rc = stat64(state->input_files[i], &sb);
|
||||
rc = stat(state->input_files[i], &sb);
|
||||
if (0 == rc)
|
||||
rc = access(state->input_files[i], R_OK);
|
||||
}
|
||||
@@ -85,13 +85,13 @@ unsigned long long pv_calc_total_size(pvstate_t state)
|
||||
* them and seeking to the end.
|
||||
*/
|
||||
if (0 == strcmp(state->input_files[i], "-")) {
|
||||
fd = open64("/dev/stdin", O_RDONLY);
|
||||
fd = open("/dev/stdin", O_RDONLY);
|
||||
} else {
|
||||
fd = open64(state->input_files[i],
|
||||
fd = open(state->input_files[i],
|
||||
O_RDONLY);
|
||||
}
|
||||
if (fd >= 0) {
|
||||
total += lseek64(fd, 0, SEEK_END);
|
||||
total += lseek(fd, 0, SEEK_END);
|
||||
close(fd);
|
||||
} else {
|
||||
pv_error(state, "%s: %s",
|
||||
@@ -115,11 +115,11 @@ unsigned long long pv_calc_total_size(pvstate_t state)
|
||||
* and that we can seek back to the start after getting the size.
|
||||
*/
|
||||
if (total <= 0) {
|
||||
rc = fstat64(STDOUT_FILENO, &sb);
|
||||
rc = fstat(STDOUT_FILENO, &sb);
|
||||
if ((0 == rc) && S_ISBLK(sb.st_mode)
|
||||
&& (0 == (fcntl(STDOUT_FILENO, F_GETFL) & O_APPEND))) {
|
||||
total = lseek64(STDOUT_FILENO, 0, SEEK_END);
|
||||
if (lseek64(STDOUT_FILENO, 0, SEEK_SET) != 0) {
|
||||
total = lseek(STDOUT_FILENO, 0, SEEK_END);
|
||||
if (lseek(STDOUT_FILENO, 0, SEEK_SET) != 0) {
|
||||
pv_error(state, "%s: %s: %s", "(stdout)",
|
||||
_
|
||||
("failed to seek to start of output"),
|
||||
@@ -150,19 +150,19 @@ unsigned long long pv_calc_total_size(pvstate_t state)
|
||||
fd = -1;
|
||||
|
||||
if (0 == strcmp(state->input_files[i], "-")) {
|
||||
rc = fstat64(STDIN_FILENO, &sb);
|
||||
rc = fstat(STDIN_FILENO, &sb);
|
||||
if ((rc != 0) || (!S_ISREG(sb.st_mode))) {
|
||||
total = 0;
|
||||
return total;
|
||||
}
|
||||
fd = dup(STDIN_FILENO);
|
||||
} else {
|
||||
rc = stat64(state->input_files[i], &sb);
|
||||
rc = stat(state->input_files[i], &sb);
|
||||
if ((rc != 0) || (!S_ISREG(sb.st_mode))) {
|
||||
total = 0;
|
||||
return total;
|
||||
}
|
||||
fd = open64(state->input_files[i], O_RDONLY);
|
||||
fd = open(state->input_files[i], O_RDONLY);
|
||||
}
|
||||
|
||||
if (fd < 0) {
|
||||
@@ -193,7 +193,7 @@ unsigned long long pv_calc_total_size(pvstate_t state)
|
||||
}
|
||||
}
|
||||
|
||||
lseek64(fd, 0, SEEK_SET);
|
||||
lseek(fd, 0, SEEK_SET);
|
||||
close(fd);
|
||||
}
|
||||
|
||||
@@ -211,8 +211,8 @@ unsigned long long pv_calc_total_size(pvstate_t state)
|
||||
*/
|
||||
int pv_next_file(pvstate_t state, int filenum, int oldfd)
|
||||
{
|
||||
struct stat64 isb;
|
||||
struct stat64 osb;
|
||||
struct stat isb;
|
||||
struct stat osb;
|
||||
int fd, input_file_is_stdout;
|
||||
|
||||
if (oldfd > 0) {
|
||||
@@ -238,7 +238,7 @@ int pv_next_file(pvstate_t state, int filenum, int oldfd)
|
||||
if (0 == strcmp(state->input_files[filenum], "-")) {
|
||||
fd = STDIN_FILENO;
|
||||
} else {
|
||||
fd = open64(state->input_files[filenum], O_RDONLY);
|
||||
fd = open(state->input_files[filenum], O_RDONLY);
|
||||
if (fd < 0) {
|
||||
pv_error(state, "%s: %s: %s",
|
||||
_("failed to read file"),
|
||||
@@ -249,7 +249,7 @@ int pv_next_file(pvstate_t state, int filenum, int oldfd)
|
||||
}
|
||||
}
|
||||
|
||||
if (fstat64(fd, &isb)) {
|
||||
if (fstat(fd, &isb)) {
|
||||
pv_error(state, "%s: %s: %s",
|
||||
_("failed to stat file"),
|
||||
state->input_files[filenum], strerror(errno));
|
||||
@@ -258,7 +258,7 @@ int pv_next_file(pvstate_t state, int filenum, int oldfd)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (fstat64(STDOUT_FILENO, &osb)) {
|
||||
if (fstat(STDOUT_FILENO, &osb)) {
|
||||
pv_error(state, "%s: %s",
|
||||
_("failed to stat output file"), strerror(errno));
|
||||
close(fd);
|
||||
|
||||
+2
-2
@@ -59,7 +59,7 @@ int pv_main_loop(pvstate_t state)
|
||||
struct timeval start_time, next_update, next_ratecheck, cur_time;
|
||||
struct timeval init_time, next_remotecheck;
|
||||
long double elapsed;
|
||||
struct stat64 sb;
|
||||
struct stat sb;
|
||||
int fd, n;
|
||||
|
||||
/*
|
||||
@@ -122,7 +122,7 @@ int pv_main_loop(pvstate_t state)
|
||||
* Set target buffer size if the initial file's block size can be
|
||||
* read and we weren't given a target buffer size.
|
||||
*/
|
||||
if ((0 == fstat64(fd, &sb)) && (0 == state->target_buffer_size)) {
|
||||
if ((0 == fstat(fd, &sb)) && (0 == state->target_buffer_size)) {
|
||||
unsigned long long sz;
|
||||
sz = sb.st_blksize * 32;
|
||||
if (sz > BUFFER_SIZE_MAX)
|
||||
|
||||
+3
-3
@@ -367,7 +367,7 @@ static int pv__transfer_read(pvstate_t state, int fd,
|
||||
state->read_error_warning_shown = 1;
|
||||
}
|
||||
|
||||
orig_offset = lseek64(fd, 0, SEEK_CUR);
|
||||
orig_offset = lseek(fd, 0, SEEK_CUR);
|
||||
|
||||
/*
|
||||
* If the file is not seekable, we can't skip past the error, so we
|
||||
@@ -412,7 +412,7 @@ static int pv__transfer_read(pvstate_t state, int fd,
|
||||
if (amount_to_skip > bytes_can_read)
|
||||
amount_to_skip = bytes_can_read;
|
||||
|
||||
skip_offset = lseek64(fd, orig_offset + amount_to_skip, SEEK_SET);
|
||||
skip_offset = lseek(fd, orig_offset + amount_to_skip, SEEK_SET);
|
||||
|
||||
/*
|
||||
* If the skip we just tried didn't work, try only skipping 1 byte
|
||||
@@ -421,7 +421,7 @@ static int pv__transfer_read(pvstate_t state, int fd,
|
||||
if (skip_offset < 0) {
|
||||
amount_to_skip = 1;
|
||||
skip_offset =
|
||||
lseek64(fd, orig_offset + amount_to_skip, SEEK_SET);
|
||||
lseek(fd, orig_offset + amount_to_skip, SEEK_SET);
|
||||
}
|
||||
|
||||
if (skip_offset < 0) {
|
||||
|
||||
+8
-8
@@ -40,9 +40,9 @@ int filesize(pvwatchfd_t info)
|
||||
* Get the size of block devices by opening
|
||||
* them and seeking to the end.
|
||||
*/
|
||||
fd = open64(info->file_fdpath, O_RDONLY);
|
||||
fd = open(info->file_fdpath, O_RDONLY);
|
||||
if (fd >= 0) {
|
||||
info->size = lseek64(fd, 0, SEEK_END);
|
||||
info->size = lseek(fd, 0, SEEK_END);
|
||||
close(fd);
|
||||
} else {
|
||||
info->size = 0;
|
||||
@@ -93,7 +93,7 @@ int pv_watchfd_info(pvstate_t state, pvwatchfd_t info, int automatic)
|
||||
|
||||
info->size = 0;
|
||||
|
||||
if (!(0 == stat64(info->file_fdpath, &(info->sb_fd)))) {
|
||||
if (!(0 == stat(info->file_fdpath, &(info->sb_fd)))) {
|
||||
if (!automatic)
|
||||
pv_error(state, "%s %u: %s %d: %s: %s",
|
||||
_("pid"),
|
||||
@@ -177,8 +177,8 @@ int pv_watchfd_info(pvstate_t state, pvwatchfd_t info, int automatic)
|
||||
return 2;
|
||||
}
|
||||
|
||||
if (!((0 == stat64(info->file_fd, &(info->sb_fd)))
|
||||
&& (0 == lstat64(info->file_fd, &(info->sb_fd_link))))) {
|
||||
if (!((0 == stat(info->file_fd, &(info->sb_fd)))
|
||||
&& (0 == lstat(info->file_fd, &(info->sb_fd_link))))) {
|
||||
if (!automatic)
|
||||
pv_error(state, "%s %u: %s %d: %s: %s",
|
||||
_("pid"),
|
||||
@@ -220,10 +220,10 @@ int pv_watchfd_changed(pvwatchfd_t info)
|
||||
*/
|
||||
int pv_watchfd_changed(pvwatchfd_t info)
|
||||
{
|
||||
struct stat64 sb_fd, sb_fd_link;
|
||||
struct stat sb_fd, sb_fd_link;
|
||||
|
||||
if ((0 == stat64(info->file_fd, &sb_fd))
|
||||
&& (0 == lstat64(info->file_fd, &sb_fd_link))) {
|
||||
if ((0 == stat(info->file_fd, &sb_fd))
|
||||
&& (0 == lstat(info->file_fd, &sb_fd_link))) {
|
||||
if ((sb_fd.st_dev != info->sb_fd.st_dev)
|
||||
|| (sb_fd.st_ino != info->sb_fd.st_ino)
|
||||
|| (sb_fd_link.st_mode != info->sb_fd_link.st_mode)
|
||||
|
||||
Reference in New Issue
Block a user