You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

213 lines
6.3 KiB

Index: src/include/pv-internal.h
--- src/include/pv-internal.h.orig 2015-10-11 00:53:50.000000000 +0200
+++ src/include/pv-internal.h 2017-07-01 23:49:14.133954000 +0200
@@ -216,8 +216,8 @@
char file_fd[4096]; /* path to /proc fd symlink */
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 */
Index: src/pv/file.c
--- src/pv/file.c.orig 2017-06-30 23:21:49.000000000 +0200
+++ src/pv/file.c 2017-07-01 23:49:14.134163000 +0200
@@ -31,7 +31,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;
@@ -41,20 +41,20 @@
* 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);
}
@@ -78,13 +78,13 @@
* 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",
@@ -108,11 +108,11 @@
* 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"),
@@ -143,19 +143,19 @@
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) {
@@ -186,7 +186,7 @@
}
}
- lseek64(fd, 0, SEEK_SET);
+ lseek(fd, 0, SEEK_SET);
close(fd);
}
@@ -204,8 +204,8 @@
*/
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) {
@@ -231,7 +231,7 @@
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"),
@@ -242,7 +242,7 @@
}
}
- if (fstat64(fd, &isb)) {
+ if (fstat(fd, &isb)) {
pv_error(state, "%s: %s: %s",
_("failed to stat file"),
state->input_files[filenum], strerror(errno));
@@ -251,7 +251,7 @@
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);
Index: src/pv/loop.c
--- src/pv/loop.c.orig 2017-06-30 23:21:49.000000000 +0200
+++ src/pv/loop.c 2017-07-01 23:49:32.672649000 +0200
@@ -53,7 +53,7 @@
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;
/*
@@ -116,7 +116,7 @@
* 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)
Index: src/pv/watchpid.c
--- src/pv/watchpid.c.orig 2017-06-30 23:21:49.000000000 +0200
+++ src/pv/watchpid.c 2017-07-01 23:49:14.134648000 +0200
@@ -69,8 +69,8 @@
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"),
@@ -90,9 +90,9 @@
* 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;
@@ -123,10 +123,10 @@
*/
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)