summaryrefslogtreecommitdiffstats
path: root/bin/dd
diff options
context:
space:
mode:
authorgreen <green@FreeBSD.org>1999-09-12 18:56:12 +0000
committergreen <green@FreeBSD.org>1999-09-12 18:56:12 +0000
commite40ba941364b555156f97e792df57b178b8d291c (patch)
tree841889466b6e74e92a217d795e01cf9d1cb79530 /bin/dd
parent347920f6fbdf6bb321a5895694e2ed2ae9b260ee (diff)
downloadFreeBSD-src-e40ba941364b555156f97e792df57b178b8d291c.zip
FreeBSD-src-e40ba941364b555156f97e792df57b178b8d291c.tar.gz
ISDISK -> ISSEEK
Allow a device type of D_DISK or D_MEM to be ISSEEK.
Diffstat (limited to 'bin/dd')
-rw-r--r--bin/dd/dd.c4
-rw-r--r--bin/dd/dd.h2
-rw-r--r--bin/dd/position.c4
3 files changed, 5 insertions, 5 deletions
diff --git a/bin/dd/dd.c b/bin/dd/dd.c
index 617cd51..ebfa792 100644
--- a/bin/dd/dd.c
+++ b/bin/dd/dd.c
@@ -222,8 +222,8 @@ getfdtype(io)
} else {
if (type & D_TAPE)
io->flags |= ISTAPE;
- else if (type & D_DISK)
- io->flags |= ISDISK;
+ else if (type & (D_DISK | D_MEM))
+ io->flags |= ISSEEK;
if (S_ISCHR(sb.st_mode) && (type & D_TAPE) == 0)
io->flags |= ISCHR;
}
diff --git a/bin/dd/dd.h b/bin/dd/dd.h
index f671baa..4e2419b 100644
--- a/bin/dd/dd.h
+++ b/bin/dd/dd.h
@@ -49,7 +49,7 @@ typedef struct {
#define ISCHR 0x01 /* character device (warn on short) */
#define ISPIPE 0x02 /* pipe (not truncatable) */
#define ISTAPE 0x04 /* tape (not seekable) */
-#define ISDISK 0x08 /* disk (valid to seek on) */
+#define ISSEEK 0x08 /* valid to seek on */
#define NOREAD 0x10 /* not readable */
u_int flags;
diff --git a/bin/dd/position.c b/bin/dd/position.c
index 6c0f684..09b69a8 100644
--- a/bin/dd/position.c
+++ b/bin/dd/position.c
@@ -68,7 +68,7 @@ pos_in()
size_t bcnt;
/* If not a character, pipe or tape device, try to seek on it. */
- if (!(in.flags & (ISCHR|ISPIPE|ISTAPE)) || in.flags & ISDISK) {
+ if (!(in.flags & (ISCHR|ISPIPE|ISTAPE)) || in.flags & ISSEEK) {
errno = 0;
if (lseek(in.fd, in.offset * in.dbsz, SEEK_CUR) == -1 &&
errno != 0)
@@ -126,7 +126,7 @@ pos_out()
ssize_t n;
/* If not a character, pipe or tape device, try to seek on it. */
- if (!(out.flags & (ISCHR|ISPIPE|ISTAPE)) || out.flags & ISDISK) {
+ if (!(out.flags & (ISCHR|ISPIPE|ISTAPE)) || out.flags & ISSEEK) {
errno = 0;
if (lseek(out.fd, out.offset * out.dbsz, SEEK_SET) == -1 &&
errno != 0)
OpenPOWER on IntegriCloud