diff options
-rw-r--r-- | bin/dd/dd.c | 4 | ||||
-rw-r--r-- | bin/dd/dd.h | 2 | ||||
-rw-r--r-- | bin/dd/position.c | 4 |
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) |