diff options
| author | David E. O'Brien <obrien@FreeBSD.org> | 2000-05-24 06:47:10 +0000 |
|---|---|---|
| committer | David E. O'Brien <obrien@FreeBSD.org> | 2000-05-24 06:47:10 +0000 |
| commit | 015a53cfff33f82b34f284c2d08ef98769dbfa75 (patch) | |
| tree | 59f7884ce13eb1cfc93a98850eb361e9d3293b0e /bin | |
| parent | 6e067727a74d61464f68ad0942ba64ce6f4bcfc3 (diff) | |
Notes
Diffstat (limited to 'bin')
| -rw-r--r-- | bin/dd/dd.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/bin/dd/dd.c b/bin/dd/dd.c index 97613f557b60..937379fc9915 100644 --- a/bin/dd/dd.c +++ b/bin/dd/dd.c @@ -52,6 +52,7 @@ static const char rcsid[] = #include <sys/param.h> #include <sys/stat.h> #include <sys/conf.h> +#include <sys/disklabel.h> #include <sys/filio.h> #include <ctype.h> @@ -218,8 +219,14 @@ getfdtype(io) } else { if (type & D_TAPE) io->flags |= ISTAPE; - else if (type & (D_DISK | D_MEM)) + else if (type & (D_DISK | D_MEM)) { + if (type & D_DISK) { + const int one = 1; + + (void)ioctl(io->fd, DIOCWLABEL, &one); + } io->flags |= ISSEEK; + } if (S_ISCHR(sb.st_mode) && (type & D_TAPE) == 0) io->flags |= ISCHR; } |
