Commit Graph

36 Commits

Author SHA1 Message Date
green
e751e53319 Relax things a bit. Not having FIODTYPE will be a warning for now.
Pointy hat:	green
Pointed out by:	peter
1999-08-28 03:37:38 +00:00
peter
3b7c52fb9a $Id$ -> $FreeBSD$ 1999-08-27 23:15:48 +00:00
green
7f73dba7d2 Use FIODTYPE to unbogosify much of the file type checking in dd. 1999-08-27 16:36:46 +00:00
green
2f941c7903 Implement seekability for disk devices (not just regular files).
Also, fix pos_out() to do the same checks pos_in() did.

Done for:	jdp, luigi, the good of the world
1999-07-13 18:44:56 +00:00
green
7f4d6d9db2 This is the second round of dd(1) changes. Some changes made/reversed by
request of Bruce. More changes may follow later. 'g' multiplier has
been added (i.e. dd seek=5g if=bigfile.) Some minor corrections were made
as well.

Noticed by: bde
1999-06-20 14:58:55 +00:00
green
1df3f4269e Miscellaneous dd(1) changes: mainly fixing variable types (size_t, ssize_t,
off_t, int, u_int64_t, etc.). dd(1) should now work properly with REALLY
big amounts of data.
1999-06-19 19:49:35 +00:00
kris
935bd87c22 Various spelling/formatting changes.
Submitted by: Philippe Charnier <charnier@xp11.frmug.org>
1999-05-08 10:22:15 +00:00
imp
efe79e057e First set of fixes to keep egcs happy. These include {} around single
statement if blocks[*] when the else could be ambiguous, not defaulting
to int type and removal of some unused variables.

[*] This is explicitly allowed by style(9) when the single statement
spans more than one line.

Reviewed by: obrien, chuckr
1999-04-25 21:13:34 +00:00
bde
5b011afdf7 Fixed printf format errors. 1998-12-07 12:37:11 +00:00
bde
76ab4c171f Describe `bs=n' more precisely. Fixed some English errors.
Obtained from:		OpenBSD
1998-11-29 13:54:20 +00:00
charnier
b844058b19 Restore Lite-2 sccsid. Restore include of sys/types.h. 1998-05-13 07:33:54 +00:00
charnier
120edffcab Correct use of .Nm and other cosmetics. Add rcsid. Remove unused #inc. 1998-05-06 06:51:42 +00:00
bde
e89d910e08 Exit with a nonzero status if we get killed by a SIGINT. POSIX.2
specifies exiting with a zero status if the file was copied
successfully, and with a nonzero status if an error occurred.  We
are too sloppy to tell if the file was copied successfully when we
get killed by a SIGINT, but it is unlikely to have been.  Added a
comment about related sloppiness (calling exit() from a signal
handler).
1998-02-24 01:45:05 +00:00
asami
984a50716d Fix printing for bytes read > 4G.
Reviewed by:	bde
1998-02-11 02:23:31 +00:00
joerg
bab3715aad Oops, back out rev 1.5, it wasn't my intention to also commit the
-g. ;)
1998-01-07 22:32:28 +00:00
joerg
57f5863136 Use the correct value in the call to swab(3) with conv=swab. Previously,
dd if=/dev/zero of=/dev=null obs=23520 conv=swab
coredumped.

Please somebody review it, i'm not 105 % sure i'm understanding all
this mess correctly.

Detected by:	Holm Tiffe <holm@geophysik.tu-freiberg.de>
1998-01-07 22:31:19 +00:00
eivind
0be8b130cc It's more portable to use <errno.h> than <sys/errno.h>
Pointed-out-by:	bde (a long while ago)
1997-12-15 20:37:43 +00:00
joerg
297798c1ce Sort "sparse" into alphabetical order, since dd's `conv' options need
to be sorted.  This temporarily broke the "osync" option.
1997-11-11 20:35:29 +00:00
joerg
5c77337149 Teach dd(1) about an option to write sparse files. Can be useful for
things like diskless clients' swap files etc.

Submitted by:	pascal@zuo.dec.com (Pascal Pederiva) (ages ago, with many
						  stylistic changes by me)
1997-10-11 20:09:05 +00:00
eivind
6d44abe78c Add <sys/errno.h> 1997-10-09 10:50:54 +00:00
eivind
fb49e457d9 make signal handlers errno safe
Obtained from:	OpenBSD (file rev 1.5) Theo de Raadt <deraadt@openbsd.org>
1997-10-08 12:59:14 +00:00
eivind
344e8d0e61 Slightly improved fix compared to my insiration
don't munge argv strings -- copy them first. avoids 'w' showing:
    deraadt  p8 zeus.theos.com    8:26AM     3 dd if of bs

Obtained from:	OpenBSD (file rev 1.3) by Theo de Raadt <deraadt@openbsd.org>
1997-10-08 12:10:33 +00:00
jlemon
d97633dae5 Pad the input buffer whenever sync is used, not just if the noerror flag
is also set.
Change osync to not to tack on an empty block if the input buffer is null,
    or an even multiple of the blocksize.
Also change osync to pad the output with nulls/spaces depending whether
   this is a block-oriented conversion or not (same as sync).

PR:		3818
1997-08-19 19:46:18 +00:00
bde
14dd6bbf0c Fixed overflow for attempts to seek to offsets > ULONG_MAX. See the
OpenBSD version for more complete fixes.  E.g., to seek to offsets >
INT_MAX using a block size of 1, block numbers need to be off_t's
instead of u_long's.
1997-04-30 17:51:29 +00:00
steve
0a7b50e32b Change spelling of ECBDIC to EBCDIC. Closes PR #3402
Submitted by:	h-nokubi@nmit.mt.nec.co.jp
1997-04-28 04:07:29 +00:00
peter
34fd560164 Revert $FreeBSD$ to $Id$ 1997-02-22 14:13:04 +00:00
jkh
9c0cd3f9df Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
steve
d20174939c -Wall cleaning. 1996-12-14 06:08:03 +00:00
phk
a62660f748 Bruce says: "You have been programming in the kernel for too long :-)."
and he's right ... I forgot about this floating point stuff you can
use in user-land :-)

Increase precision of duration to microseconds.
No heuristics to avoid overflow in calculation needed - just depend
on DBL_MAX being a bit larger than LONG_MAX.

Use double instead of `struct timeval' in dd.h so that everything
doesn't have to include <sys/time.h>.

Fixed style bugs in recent and old FreeBSD changes.

Reviewed by:	phk
Submitted by:	bde
1996-11-13 20:00:03 +00:00
phk
bd404ae822 Increase precision of duration to milliseconds.
Some heuristics to avoid overflow in calculation attempted.
1996-11-12 23:09:15 +00:00
ache
3424b01c58 Add setlocale LC_CTYPE 1995-10-23 21:31:48 +00:00
ache
c8efc4e242 More koshering [ul]case fix, don't use pre-initialized tables at all,
treat 0xFF as valid character.
1995-01-17 23:04:29 +00:00
ache
396da72c9a Make conv=[lu]case works with localized ctype (8bit) 1995-01-17 22:55:59 +00:00
dg
00eb2a4dc0 Added $Id$ 1994-09-24 02:59:15 +00:00
phk
a1aa4c1dd2 Applied patch to make -Wall and -Dlint shut up.
Reviewed by:	phk
Submitted by:	Josef Grosch <joeg@gagme.wwa.com>
1994-09-20 06:24:56 +00:00
rgrimes
e3cfc8ce61 BSD 4.4 Lite bin Sources 1994-05-26 06:18:55 +00:00