mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-13 10:02:38 +00:00
Fix ``dd if=/dev/zero of=/dev/daN'' on the Alpha by allowing the label
to be overwritten. Submitted by: green
This commit is contained in:
parent
6e067727a7
commit
015a53cfff
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=60859
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user