]> git.cameronkatri.com Git - bsd-progress.git/log
bsd-progress.git
4 years agoftp: don't use restartable signals
lukem [Wed, 6 Jan 2021 04:43:14 +0000 (04:43 +0000)]
ftp: don't use restartable signals

Refactor to not rely upon restartable signals (SA_RESTART),
possibly fixing intermittent failures with -q QUITTIME.

ftp transfers: handle EINTR/EAGAIN in copy_bytes(),
instead of relying upon restartable signals.

http/https transfers: Explicitly print an error similar to
progressmeter() when timing-out for -Q QUITTIME in fetch_wait(),
and set errno to ETIMEDOUT so that the warn() in fetch_url()
prints a more accurate error message.

PR/55857

4 years agoWhitespace nit.
simonb [Sat, 25 Apr 2020 11:12:39 +0000 (11:12 +0000)]
Whitespace nit.

5 years agoSync with 2019b (field name change)
christos [Wed, 3 Jul 2019 15:49:21 +0000 (15:49 +0000)]
Sync with 2019b (field name change)

5 years agomake this compile again with -DNO_PROGRESS
christos [Sat, 22 Jun 2019 23:40:33 +0000 (23:40 +0000)]
make this compile again with -DNO_PROGRESS

5 years agomerge tzcode 2019a
christos [Thu, 4 Apr 2019 18:18:52 +0000 (18:18 +0000)]
merge tzcode 2019a

9 years agoupdatre with latest from tzcode.
christos [Sat, 11 Jul 2015 16:40:53 +0000 (16:40 +0000)]
updatre with latest from tzcode.

10 years agoRetry read() on EINTR. Fixes premature exit of
gson [Sat, 17 Jan 2015 10:57:51 +0000 (10:57 +0000)]
Retry read() on EINTR.  Fixes premature exit of
</dev/random progress -e cat >/dev/null

10 years agoChange some standard exit status text to ".Ex -std"
snj [Sun, 13 Apr 2014 01:45:34 +0000 (01:45 +0000)]
Change some standard exit status text to ".Ex -std"
From Eitan Adler in PR bin/47790.

12 years agoClean up #includes in progress(1).
riastradh [Wed, 27 Jun 2012 22:07:36 +0000 (22:07 +0000)]
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...

13 years agoPut a recursion limit to avoid DoS attacks (Maksymilian Arciemowicz)
christos [Sat, 22 Oct 2011 22:08:47 +0000 (22:08 +0000)]
Put a recursion limit to avoid DoS attacks (Maksymilian Arciemowicz)
While there do minor KNF, and do as the manual says: exit with EXIT_FAILURE

13 years agoUse __dead
joerg [Fri, 16 Sep 2011 15:39:25 +0000 (15:39 +0000)]
Use __dead

14 years agoFix argument handling of the "-b" option on 64bit platforms. Using
tron [Sat, 17 Jul 2010 10:51:03 +0000 (10:51 +0000)]
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.

15 years agoFix numerous WARNS=4 issues (-Wcast-qual -Wsign-compare).
lukem [Sun, 12 Apr 2009 10:18:52 +0000 (10:18 +0000)]
Fix numerous WARNS=4 issues (-Wcast-qual -Wsign-compare).

16 years agoupdate copyrights
lukem [Tue, 30 Sep 2008 03:41:53 +0000 (03:41 +0000)]
update copyrights

16 years agoCosmetic fix: don't exit without completing the progress bar, either on
dholland [Mon, 26 May 2008 04:53:11 +0000 (04:53 +0000)]
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.

16 years agoConvert TNF licenses to new 2 clause variant
martin [Wed, 30 Apr 2008 13:10:46 +0000 (13:10 +0000)]
Convert TNF licenses to new 2 clause variant

16 years agoConvert to new 2 clause license
martin [Tue, 29 Apr 2008 06:53:00 +0000 (06:53 +0000)]
Convert to new 2 clause license

16 years agoRemove clause 3 and 4 from TNF licenses
martin [Mon, 28 Apr 2008 20:22:51 +0000 (20:22 +0000)]
Remove clause 3 and 4 from TNF licenses

16 years agoTurn off the alarmtimer before resetting the SIGALRM handler back to SIG_DFL.
lukem [Mon, 21 Jan 2008 10:31:28 +0000 (10:31 +0000)]
Turn off the alarmtimer before resetting the SIGALRM handler back to SIG_DFL.
Fix from dieter roelants <dieter.NetBSD@pandora.be>
Should fix PR 35630.

17 years agoDynamically allocate the buffer used for reading data from the input
briggs [Wed, 6 Jun 2007 17:49:14 +0000 (17:49 +0000)]
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.

17 years agoconst-as-const-can: make the "suffixes" pointers const, as probably was
martin [Sat, 5 May 2007 18:09:24 +0000 (18:09 +0000)]
const-as-const-can: make the "suffixes" pointers const, as probably was
intended, but done wrong originally (redundant const was removed
per PR bin/36280)

17 years agoPR/36280: Christer Folkesson: Remove extra const
christos [Sat, 5 May 2007 16:57:54 +0000 (16:57 +0000)]
PR/36280: Christer Folkesson: Remove extra const

17 years ago* Implement -s srcaddr; uses srcaddr as the local IP address for all
lukem [Tue, 17 Apr 2007 05:52:03 +0000 (05:52 +0000)]
* Implement -s srcaddr; uses srcaddr as the local IP address for all
  connections.
  Based on code in the version of ftp that FreeBSD had before they
  replaced it with lukemftp.
* Move error message handling into ftp_connect() rather than in the
  caller, so that more specific error reporting can occur.
* Improve consistency of various warning and error messages.

17 years agoUse IEC 60027-2 prefixes for 2^n based prefixes.
lukem [Thu, 12 Apr 2007 06:50:39 +0000 (06:50 +0000)]
Use IEC 60027-2 prefixes for 2^n based prefixes.

17 years agoUpdate example to use KiB per recent change to ../ftp/progressbar.c
lukem [Thu, 12 Apr 2007 06:31:20 +0000 (06:31 +0000)]
Update example to use KiB per recent change to ../ftp/progressbar.c

17 years agoUse the IEC 60027-2 2^n based "KiB", "MiB", "GiB", (etc)
lukem [Thu, 12 Apr 2007 06:13:02 +0000 (06:13 +0000)]
Use the IEC 60027-2 2^n based "KiB", "MiB", "GiB", (etc)
suffixes for byte displays since we're using 2^n scaling,
instead of the SI 10^n based "KB", "MB", "GB" (etc).

17 years ago#include inttypes.h, for strtoimax(3).
hubertf [Wed, 7 Feb 2007 15:21:21 +0000 (15:21 +0000)]
#include inttypes.h, for strtoimax(3).
Suggested by Slava Semushin <slava.semushin@gmail.com> in private email.

17 years ago* Remove unneeded ctype.h
hubertf [Wed, 7 Feb 2007 14:06:57 +0000 (14:06 +0000)]
* Remove unneeded ctype.h
* remove unneeded {}s
* add some whitespace for readability

Contributed by Slava Semushin <slava.semushin@gmail.com> in private mail.

18 years agoCoverity CID 1447: Avoid buffer overflow.
christos [Mon, 1 May 2006 23:02:03 +0000 (23:02 +0000)]
Coverity CID 1447: Avoid buffer overflow.

18 years agoCoverity CID 1448: Avoid static array overflow.
christos [Mon, 1 May 2006 23:00:33 +0000 (23:00 +0000)]
Coverity CID 1448: Avoid static array overflow.

18 years agoDon't try to determining the size of what's coming when reading from a pipe.
hubertf [Thu, 20 Apr 2006 23:20:55 +0000 (23:20 +0000)]
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@

19 years agoBump date for -e.
wiz [Thu, 12 Jan 2006 21:52:01 +0000 (21:52 +0000)]
Bump date for -e.

19 years agoApply patch from PR bin/28717
garbled [Thu, 12 Jan 2006 20:33:20 +0000 (20:33 +0000)]
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"

19 years agoRevert back to using an int (instead of size_t) for holding a value that may
lukem [Tue, 19 Jul 2005 00:41:05 +0000 (00:41 +0000)]
Revert back to using an int (instead of size_t) for holding a value that may
be negative.
Fixes progressbar display on terminals <43 columns wide.
Bug noted and solution suggested by Gavan Fantom.

19 years agocopyright maintenance
lukem [Thu, 9 Jun 2005 16:38:29 +0000 (16:38 +0000)]
copyright maintenance

19 years agoPrintf field widths and size_t don't always mix well, so cast to int.
he [Fri, 20 May 2005 07:26:01 +0000 (07:26 +0000)]
Printf field widths and size_t don't always mix well, so cast to int.
Fixes build problem for alpha.

19 years agoUse size_t instead of int where appropriate.
lukem [Thu, 19 May 2005 03:05:04 +0000 (03:05 +0000)]
Use size_t instead of int where appropriate.

19 years agogratuitous whitespace cleanup (before someone else jumps the gun...)
lukem [Mon, 11 Apr 2005 01:49:31 +0000 (01:49 +0000)]
gratuitous whitespace cleanup (before someone else jumps the gun...)

19 years agoExit with any failure code from the cmd or gzip.
dsl [Wed, 23 Feb 2005 22:32:31 +0000 (22:32 +0000)]
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)

19 years agoWhite space nit
jmc [Thu, 10 Feb 2005 16:00:38 +0000 (16:00 +0000)]
White space nit

19 years agoFix compilation issues for NO_PROGRESS
jmc [Thu, 10 Feb 2005 16:00:28 +0000 (16:00 +0000)]
Fix compilation issues for NO_PROGRESS

20 years agoSupport strsuftoll(3) suffixes for '-l length'.
lukem [Sat, 3 Apr 2004 06:19:22 +0000 (06:19 +0000)]
Support strsuftoll(3) suffixes for '-l length'.
Provide an example of copying raw disks using dd, with a progress bar.

20 years ago-z actually passes the input file through gunzip(1).
hubertf [Thu, 25 Mar 2004 20:29:51 +0000 (20:29 +0000)]
-z actually passes the input file through gunzip(1).
Having an option to really pass it through gzip(1) would be nice...

20 years agoDrop trailing whitespace.
wiz [Tue, 9 Mar 2004 19:04:09 +0000 (19:04 +0000)]
Drop trailing whitespace.

20 years agoAllow custom text printed before (left of) the progress bar from progress(1):
hubertf [Tue, 9 Mar 2004 17:04:24 +0000 (17:04 +0000)]
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.

20 years agoExplicitly use base 10 when parsing numbers, to enforce the "decimal number"
lukem [Fri, 5 Mar 2004 05:58:29 +0000 (05:58 +0000)]
Explicitly use base 10 when parsing numbers, to enforce the "decimal number"
semantics that the comments referred to and as per dd(1) (which was the
origin of this functionality).

21 years agoprint max rather than min in error message when number
dbj [Sat, 17 Jan 2004 23:02:51 +0000 (23:02 +0000)]
print max rather than min in error message when number
parsed by strsuftollx is greater than max

21 years agoOverhaul how `build.sh tools' are used:
lukem [Mon, 27 Oct 2003 00:12:41 +0000 (00:12 +0000)]
Overhaul how `build.sh tools' are used:

    * Rename "config.h" to "nbtool_config.h" and
HAVE_CONFIG_H to HAVE_NBTOOL_CONFIG_H.
This makes in more obvious in the source when we're using
tools/compat/config.h versus "standard autoconf" config.h

    * Consistently move the inclusion of nbtool_config.h to before
     <sys/cdefs.h> so that the former can provide __RCSID() (et al),
     and there's no need to protect those macros any more.

These changes should make it easier to "tool-ify" a program by adding:
#if HAVE_NBTOOL_CONFIG_H
#include "nbtool_config.h"
#endif
to the top of the source files (for the general case).

21 years agoMove UCB-licensed code from 4-clause to 3-clause licence.
agc [Thu, 7 Aug 2003 16:42:00 +0000 (16:42 +0000)]
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.

21 years agoMove UCB-licensed code from 4-clause to 3-clause licence.
agc [Thu, 7 Aug 2003 09:44:09 +0000 (09:44 +0000)]
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22270, verified by myself.

21 years agotweak copyright; the stuff jason did in util.c wasn't migrated to this file.
lukem [Thu, 17 Jul 2003 12:06:18 +0000 (12:06 +0000)]
tweak copyright; the stuff jason did in util.c wasn't migrated to this file.

21 years agoCrank dates on TNF copyright.
lukem [Fri, 28 Feb 2003 09:53:49 +0000 (09:53 +0000)]
Crank dates on TNF copyright.
Remove UCB & WIDE copyrights; the progressbar functionality was
written entirely by me under the TNF copyright.

21 years agoThe correct capitalisation of 'NetBSD.org' is (you
grant [Fri, 14 Feb 2003 15:59:16 +0000 (15:59 +0000)]
The correct capitalisation of 'NetBSD.org' is (you
guessed it) 'NetBSD.org'.

some mdoc fixes.

21 years agochange a couple #ifdef's so /usr/bin/progress doesn't stomp all over
grant [Wed, 12 Feb 2003 15:18:28 +0000 (15:18 +0000)]
change a couple #ifdef's so /usr/bin/progress doesn't stomp all over
the tty if it's not in the foreground.

ok'd by jhawk.

21 years agoSigh, use an even more elaborate wait loop; it turns out we have a child
ross [Wed, 12 Feb 2003 00:58:34 +0000 (00:58 +0000)]
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.

21 years agoremove section name comments -- they're in the template.
grant [Mon, 10 Feb 2003 23:59:16 +0000 (23:59 +0000)]
remove section name comments -- they're in the template.

21 years agoFix a race that can abort a sysinst run.
ross [Mon, 10 Feb 2003 09:10:01 +0000 (09:10 +0000)]
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.

21 years agoUse definition in "namespace.h" to rename functions, not home grown.
itohy [Sat, 8 Feb 2003 07:27:51 +0000 (07:27 +0000)]
Use definition in "namespace.h" to rename functions, not home grown.

21 years agoMake this build on non-i386 platforms.
agc [Wed, 22 Jan 2003 10:44:17 +0000 (10:44 +0000)]
Make this build on non-i386 platforms.

21 years agoDrop gratuitous warning for failure to get terminal width; it makes piping
jhawk [Wed, 22 Jan 2003 04:11:34 +0000 (04:11 +0000)]
Drop gratuitous warning for failure to get terminal width; it makes piping
progress' output ugly.

21 years agoRemove second item in BUGS section; it is fixed in progress.c rev. 1.2.
enami [Wed, 22 Jan 2003 03:40:33 +0000 (03:40 +0000)]
Remove second item in BUGS section; it is fixed in progress.c rev. 1.2.

21 years agonot all windows have 80 columns.
christos [Wed, 22 Jan 2003 03:24:21 +0000 (03:24 +0000)]
not all windows have 80 columns.

21 years agoAdvance a pointer correctly.
enami [Wed, 22 Jan 2003 03:13:32 +0000 (03:13 +0000)]
Advance a pointer correctly.

21 years agouse ftp(1) instead of lukemftp
lukem [Wed, 22 Jan 2003 02:58:16 +0000 (02:58 +0000)]
use ftp(1) instead of lukemftp

21 years agoneed bsd.own.mk for NETBSDSRCDIR
lukem [Wed, 22 Jan 2003 02:56:30 +0000 (02:56 +0000)]
need bsd.own.mk for NETBSDSRCDIR

21 years agoprogress(1) is a standalone version of lukemftp's progress bar
jhawk [Wed, 22 Jan 2003 00:14:12 +0000 (00:14 +0000)]
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.

22 years agoAbstract out progress bar support into progressbar.[ch], for inclusion
jhawk [Tue, 21 Jan 2003 16:08:06 +0000 (16:08 +0000)]
Abstract out progress bar support into progressbar.[ch], for inclusion
in external programs (conditionalized on -DSTANDALONE_PROGRESS).

The following moved from util.c to progressbar.c:
  alarmtimer(), progressmeter(), psummary(), ptransfer(),
  xsignal(), xsignal_restart()

The following moved from extern.h and ftp_var.h to progressbar.h:
  STALLTIME, verbose, fromatty, progress, quit_time, ttywidth

22 years agoadd strsuftoll(3) and strsuftollx(3) - parse a string for a number
lukem [Fri, 29 Nov 2002 12:58:14 +0000 (12:58 +0000)]
add strsuftoll(3) and strsuftollx(3) - parse a string for a number
with an optional suffix, product (two numbers separated by `x'), and
provide range checking

26 years agoMerge in recent changes from the private version of this header distributed
kleink [Thu, 30 Jul 1998 14:11:22 +0000 (14:11 +0000)]
Merge in recent changes from the private version of this header distributed
with tzcode.

26 years agomerge lite-2
perry [Mon, 2 Feb 1998 21:07:13 +0000 (21:07 +0000)]
merge lite-2

27 years agoadd parens in isleap() for gcc -Wall
mikel [Fri, 25 Jul 1997 05:54:42 +0000 (05:54 +0000)]
add parens in isleap() for gcc -Wall

30 years agonew RCS ID format.
cgd [Wed, 26 Oct 1994 00:55:40 +0000 (00:55 +0000)]
new RCS ID format.

31 years agoAdd RCS identifiers.
mycroft [Sun, 1 Aug 1993 17:54:45 +0000 (17:54 +0000)]
Add RCS identifiers.

31 years agoinitial import of 386bsd-0.1 sources
cgd [Sun, 21 Mar 1993 09:45:37 +0000 (09:45 +0000)]
initial import of 386bsd-0.1 sources

32 years agoinitial empty check-in
srcmastr [Mon, 13 Jul 1992 16:18:24 +0000 (16:18 +0000)]
initial empty check-in