}
static void
-zap_bootbits(int fd, const char *devname, int force)
+zap_bootbits(int fd, const char *devname, int force, int is_blkdev)
{
char *type = NULL;
int whole = 0;
if (lseek(fd, 0, SEEK_SET) != 0)
die(_("unable to rewind swap-device"));
- if (is_whole_disk_fd(fd, devname)) {
+ if (is_blkdev && is_whole_disk_fd(fd, devname)) {
/* don't zap bootbits on whole disk -- we know nothing
* about bootloaders on the device */
whole = 1;
if (check)
check_blocks();
- zap_bootbits(DEV, device_name, force);
+ zap_bootbits(DEV, device_name, force, S_ISBLK(statbuf.st_mode));
p->version = 1;
p->last_page = PAGES-1;