From 015a53cfff33f82b34f284c2d08ef98769dbfa75 Mon Sep 17 00:00:00 2001 From: "David E. O'Brien" Date: Wed, 24 May 2000 06:47:10 +0000 Subject: [PATCH] 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(-) 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 #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; }