Commit Graph
41 Commits
Author SHA1 Message Date
Andrew Wood befcddc994 Address warnings raised by splint. 2023-09-03 16:02:00 +01:00
Andrew Wood 86feafb721 Rename "doc" directory to "docs" to match Debian standards. 2023-09-03 00:40:26 +01:00
Andrew Wood 78bb93b288 Move terminal TOSTOP attribute changes into signal handling functions and only set/unset that attribute rather than saving and restoring the whole terminal state; keep track of whether we have changed it and change cursor positioning IPC data to a structure so the state change can be shared with all "pv -c" instances. 2023-09-02 22:06:31 +01:00
Andrew Wood 14ce832249 New "--error-skip-block" option. 2023-09-02 01:21:18 +01:00
Andrew Wood d51a1b10f0 Corrections to file header comments. 2023-08-31 21:49:27 +01:00
Andrew Wood 1f320dd7a2 Replace all gettimeofday() calls, and elapsed time arithmetic, with a new set of elapsed time functions based on clock_gettime(), to avoid faults due to time zone / DST changes and machine suspend/resume. 2023-08-30 22:23:43 +01:00
Andrew Wood b7eb3c9e90 Record whether the width or height were set manually, and refrain from changing a manually set value when the terminal size changes. 2023-08-28 22:03:14 +01:00
Andrew Wood 9e5bdeb3a4 Added "--discard" option. 2023-08-28 21:05:45 +01:00
Andrew Wood 0bd1b82d3a Move libgen.h out of IPC conditional code since it is not related directly to IPC; adjust IPC configuration so that IPC support is auto-disabled if the relevant header files or library functions are missing. 2023-08-28 17:44:53 +01:00
Andrew Wood 2a092c9495 Rename "null" state boolean to "null_terminated_lines" so it is more descriptive and less confusing. 2023-08-28 16:18:51 +01:00
Andrew Wood 66cae656d1 Rename state variable "no_op" to the more descriptive "no_display", as pv is not doing nothing when this is set, it is still transferring data. 2023-08-28 15:20:51 +01:00
Andrew Wood b1ef744058 Use posix_fadvise() on input files, where available. 2023-08-28 13:10:38 +01:00
Andrew Wood e99548ea8a Major restructuring to switch build system from old scripts to GNU Automake. 2023-08-28 10:04:39 +01:00
Andrew Wood fe22f0e449 Store name and format string in internal state as their own copies rather than pointers to strings outside the state, for memory safety and to avoid a leak on remote control. 2023-08-26 20:49:30 +01:00
Andrew Wood 4cd28b23f0 Adjustments and annotations as per splint and flawfinder reports. 2023-08-14 23:07:37 +01:00
Andrew Wood cc4d1a15e4 Make the filenames in the list constant. 2023-08-14 22:37:23 +01:00
Andrew Wood 7f25aff91d Adjustments and annotations as per splint and flawfinder reports. 2023-08-14 22:33:06 +01:00
Andrew Wood f01117d84e Adjustments and annotations as per splint and flawfinder reports. 2023-08-14 20:56:11 +01:00
Andrew Wood 34fe796806 Refactored "--help" to support multi-byte character locales when word wrapping, and clear all "splint" and "flawfinder" warnings. 2023-07-29 21:32:34 +01:00
Andrew Wood b9f96d9508 Provide new option "--debug" instead of using insecure environment variable DEBUG. 2023-07-28 23:14:14 +01:00
Andrew Wood cd9f057f15 Removed incorrect undef HAVE_STDBOOL_H which caused standard boolean types to be redefined unnecessarily. 2023-07-28 21:55:57 +01:00
Andrew Wood ae81f83e9b New option "--direct-io". 2023-07-27 21:44:30 +01:00
Andrew Wood 6cff3c1c2a First draft of new "--sync" option. 2023-07-26 22:17:00 +01:00
Andrew Wood c7e0bb727e Introduce strlcat() instead of strcat(), and replace all sizeof() of buffers inside structures with constants where possible, to avoid bugs caused by reading the size of a pointer instead of the size of the buffer it points to. 2023-07-23 01:57:00 +01:00
Andrew Wood e94600d7a4 Put all terminal writes through the same pv_write_retry function for consistency and to clear up compiler warnings. 2023-07-22 23:22:34 +01:00
Andrew Wood b6d1f62979 Centralise all sprintf()/snprintf() calls in a compatibility wrapper pv_snprintf() 2023-07-22 22:40:07 +01:00
Andrew Wood 101294195b Remove references to 64-bit file functions - stat, lstat, lseek, etc - as part of large file support rewrite. 2023-07-22 19:55:55 +01:00
Andrew Wood 7448c7f320 Rewrote configure.in and replaced header.in with one generated by autoheader, added copyright notice to all source files as per GNU standards, and changed "pv --version" output to conform to GNU standards. 2023-07-22 19:35:43 +01:00
Andrew Wood f13f5e70c1 More macOS stat fixes 2023-07-17 21:37:54 +01:00
Andrew Wood 461486ec4f Added --bits option 2023-07-16 23:12:12 +01:00
Andrew Wood 4fddf40436 Rename --eta-window to --average-rate-window, since that is what it does, and correct the behaviour of the final update so the final rate shown is the average rate across the whole transfer. 2023-07-16 21:00:08 +01:00
Andrew WoodandGitHub 56adce8edf Merge branch 'main' into eta_fix 2023-07-16 11:41:50 +01:00
Andrew Wood 442a298c38 Merge branch 'main' of https://github.com/vbychkoviak/pv into vbychkoviak-main 2023-07-16 11:23:46 +01:00
Andrew Wood 9dce037cdc Merge branch 'mac_os_x_pidfds' of https://github.com/christoph-zededa/pv into christoph-zededa-mac_os_x_pidfds 2023-07-16 01:37:08 +01:00
Kang Daeyoun 5768166460 Use relative filepath in watchpid if possible 2023-06-09 12:32:59 +09:00
lemonsqueeze 6bdb951af4 Added -m, --eta-window option: set time window for average rate computation (default 30s) 2023-05-29 15:11:37 +02:00
lemonsqueeze 06824aee2d Fixed inaccurate ETAs: use current average rate over last 30 seconds instead of global rate
using global rate gives wildly inacurrate ETAs if rate changes over time.

this makes pv keep a history of progress over the last 30s interval and compute
current average rate over that, which fixes the issue.

fixed -a, --average-rate: show current average rate instead of global rate

[ quick test ]

- in one shell:
    $ dd if=/dev/zero of=/tmp/foo bs=1M count=5                 # simulate fast initial rate,
    $ (while true; do ls /*; sleep 1; done) >> /tmp/foo         # then slow rate. leave running ...

- in another shell:
    $ tail -f -n +1 /tmp/foo | pv -s 800M > /dev/null

    5.62MiB 0:00:17 [33.1KiB/s] [>                              ]  0% ETA 0:40:02
        bad:  (pv 1.6.6 - 1.6.20)
        ETA of a few minutes that keeps increasing ever and ever ...

    5.62MiB 0:00:16 [33.1KiB/s] [>                              ]  0% ETA 6:45:53
        good:
        ETA of 6+ hours, which is how long it'll take to reach 800Mb at 33k/s
2023-05-29 15:09:36 +02:00
Volodymyr Bychkovyak a6ecf60ad1 fix rate limiting issues 2023-03-22 02:49:46 -07:00
Christoph Ostarek b0cad6d3e3 implement fd watching for OS X 2023-02-19 18:20:00 +01:00
Andrew Wood 7d68a574ca Added all changes made between v1.6.6 and June 2020 2021-09-04 21:00:00 +01:00
Andrew Wood 12f28d0689 Initial commit based on v1.6.6 2021-09-04 20:51:25 +01:00