From f84c12deda673f8103d06563efebe0bc6b83b1ac Mon Sep 17 00:00:00 2001 From: obrien Date: Wed, 24 May 2000 06:47:10 +0000 Subject: Fix ``dd if=/dev/zero of=/dev/daN'' on the Alpha by allowing the label to be overwritten. Submitted by: green --- bin/dd/dd.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'bin/dd') diff --git a/bin/dd/dd.c b/bin/dd/dd.c index 97613f5..937379f 100644 --- a/bin/dd/dd.c +++ b/bin/dd/dd.c @@ -52,6 +52,7 @@ static const char rcsid[] = #include #include #include +#include #include #include @@ -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; } -- cgit v1.1