Commit Graph

36 Commits

Author SHA1 Message Date
gson e1d1003b4c Add missing check for error returns from read(). Found by inspection
while reviewing the changes suggested by RVP in PR install/56303, but
not believed to be the cause of the failure reported in that PR.
2021-08-17 07:18:43 +00:00
gson a016b984d7 Test errno when the return value from wait() indicates an error, not
when it indicates success.  PR install/56303.
2021-08-09 10:46:39 +00:00
lukem 0de2ffcfac progress: handle EINTR in writes. PR/55914 2021-01-07 12:02:52 +00:00
simonb d8e1fd5fbe Whitespace nit. 2020-04-25 11:12:39 +00:00
gson 7a9652e2cb Retry read() on EINTR. Fixes premature exit of
</dev/random progress -e cat >/dev/null
2015-01-17 10:57:51 +00:00
snj fc99b6a4d6 Change some standard exit status text to ".Ex -std"
From Eitan Adler in PR bin/47790.
2014-04-13 01:45:34 +00:00
riastradh 9a313cc58d Clean up #includes in progress(1).
Sort them, omit needless ones, and add omitted needful ones.

Omissions revealed by pilfering the code and trying to build it on
Mac OS X.  We ought to have a better way to reveal these omissions...
2012-06-27 22:07:36 +00:00
joerg 6818646ac8 Use __dead 2011-09-16 15:39:25 +00:00
tron 40771355a2 Fix argument handling of the "-b" option on 64bit platforms. Using
"-b 1024k" would previously fail with this error message:

progress: buffer size 1048576 is greater than -1.
2010-07-17 10:51:03 +00:00
dholland 89a35a0e0a Cosmetic fix: don't exit without completing the progress bar, either on
write error or by receiving SIGPIPE. This avoids leaving the tty in a
mess. Probably addresses PR 30287.
2008-05-26 04:53:11 +00:00
martin 11a6dbe728 Convert TNF licenses to new 2 clause variant 2008-04-30 13:10:46 +00:00
martin 3028e483e4 Convert to new 2 clause license 2008-04-29 06:53:00 +00:00
briggs ac798ebce1 Dynamically allocate the buffer used for reading data from the input
handle and default to 64k instead of the 1k (BUFSIZ) static buffer.
This makes a large difference in performance of some applications.
Make the buffer size tunable from the command line.
2007-06-06 17:49:14 +00:00
lukem 3d05e3a2bc Update example to use KiB per recent change to ../ftp/progressbar.c 2007-04-12 06:31:20 +00:00
hubertf 79b63fa656 #include inttypes.h, for strtoimax(3).
Suggested by Slava Semushin <slava.semushin@gmail.com> in private email.
2007-02-07 15:21:21 +00:00
hubertf 1a7e106bf0 * Remove unneeded ctype.h
* remove unneeded {}s
* add some whitespace for readability

Contributed by Slava Semushin <slava.semushin@gmail.com> in private mail.
2007-02-07 14:06:57 +00:00
hubertf ce8f04b19d Don't try to determining the size of what's coming when reading from a pipe.
Instead of reporting some bogus values, print no progress at all.
(It's beyond me why stat(2) on a pipe returns funny values...
 see the PR below for some examples!)

Fixes PR bin/33207 by myself.

OK'd by mrg@
2006-04-20 23:20:55 +00:00
wiz 1f5df3a237 Bump date for -e. 2006-01-12 21:52:01 +00:00
garbled ddd39082c1 Apply patch from PR bin/28717
This adds a -e option to progress which causes the progress bar to be
sent to stderr.  This allows using progress mid-pipe, such as:
tar -cf . | progress -e bzip -1c | ssh host "cat > file"
2006-01-12 20:33:20 +00:00
dsl 8d3b64e3cb Exit with any failure code from the cmd or gzip.
Decode gzip -l output with strtoimax() (not sscanf()) so we don't use an
uninitialised variable if the output format isn't what we expect.
This might fix some installation PRs (no error being reported)
2005-02-23 22:32:31 +00:00
lukem f9f551db32 Support strsuftoll(3) suffixes for '-l length'.
Provide an example of copying raw disks using dd, with a progress bar.
2004-04-03 06:19:22 +00:00
hubertf 89cb93c02e -z actually passes the input file through gunzip(1).
Having an option to really pass it through gzip(1) would be nice...
2004-03-25 20:29:51 +00:00
wiz 610cd4021b Drop trailing whitespace. 2004-03-09 19:04:09 +00:00
hubertf 849866f9c1 Allow custom text printed before (left of) the progress bar from progress(1):
miyu# cat openoffice-linux-1.1.0.tgz | progress -z -p 'Bytes written: ' dd of=/dev/null bs=1m
	Bytes written:    193 MB   13.83 MB/s 0+195211 records in
and:
	miyu# progress -f openoffice-linux-1.1.0.tgz -z -p 'Bytes written: ' dd of=/dev/null bs=1m
	Bytes written:  28% |******                | 57919 KB   14.12 MB/s    00:09 ETA

OK'd by lukem.
2004-03-09 17:04:24 +00:00
grant 2ceb845887 The correct capitalisation of 'NetBSD.org' is (you
guessed it) 'NetBSD.org'.

some mdoc fixes.
2003-02-14 15:59:16 +00:00
ross 0328c52302 Sigh, use an even more elaborate wait loop; it turns out we have a child
before we even start when run from sysinst. Thanks also Takao Shinohara.
2003-02-12 00:58:34 +00:00
grant 4352e01ddb remove section name comments -- they're in the template. 2003-02-10 23:59:16 +00:00
ross 182f33ad44 Fix a race that can abort a sysinst run.
Closes bin/20275, thank you Takao Shinohara: good analysis.

This program appeared less than 3 weeks ago and it has already been
pulled up to 1.6.1?  At the last minute?  And with serious bugs?
ISTM that the release branch isn't supposed to work that way. It
isn't stable, it had 4 patches in 2 days, and has averaged a
patch every 4 days during its short lifetime.
2003-02-10 09:10:01 +00:00
agc 24b6883844 Make this build on non-i386 platforms. 2003-01-22 10:44:17 +00:00
jhawk 252f8847d5 Drop gratuitous warning for failure to get terminal width; it makes piping
progress' output ugly.
2003-01-22 04:11:34 +00:00
enami cb5a2282ea Remove second item in BUGS section; it is fixed in progress.c rev. 1.2. 2003-01-22 03:40:33 +00:00
christos 18350cdfbe not all windows have 80 columns. 2003-01-22 03:24:21 +00:00
enami 23066b7faf Advance a pointer correctly. 2003-01-22 03:13:32 +00:00
lukem 8d469d6c4b use ftp(1) instead of lukemftp 2003-01-22 02:58:16 +00:00
lukem b489ebc3bf need bsd.own.mk for NETBSDSRCDIR 2003-01-22 02:56:30 +00:00
jhawk 98f6cccbef progress(1) is a standalone version of lukemftp's progress bar
(pulled in via reachover makefile) suitable for measuring the
input to arbitrary pipes.
This is intended for use by sysinst.
2003-01-22 00:14:12 +00:00