diff --git a/disk-utils/mkfs.minix.c b/disk-utils/mkfs.minix.c index 405e241b9..328e285a9 100644 --- a/disk-utils/mkfs.minix.c +++ b/disk-utils/mkfs.minix.c @@ -659,8 +659,7 @@ int main(int argc, char ** argv) { int sectorsize; if (blkdev_get_sector_size(DEV, §orsize) == -1) - errx(MKFS_ERROR, _("cannot determine sector size for %s"), - device_name); + sectorsize = DEFAULT_SECTOR_SIZE; /* kernel < 2.3.3 */ if (BLOCK_SIZE < sectorsize) errx(MKFS_ERROR, _("block size smaller than physical " "sector size of %s"), device_name); diff --git a/lib/blkdev.c b/lib/blkdev.c index d889b787f..3f652bb60 100644 --- a/lib/blkdev.c +++ b/lib/blkdev.c @@ -179,24 +179,17 @@ blkdev_get_sectors(int fd, unsigned long long *sectors) return -1; } -/* get logical sector size (default is 512) +/* + * Get logical sector size. * * This is the smallest unit the storage device can * address. It is typically 512 bytes. */ -int -blkdev_get_sector_size(int fd, int *sector_size) +int blkdev_get_sector_size(int fd, int *sector_size) { #ifdef BLKSSZGET -#ifdef __linux__ - if (get_linux_version() < KERNEL_VERSION(2,3,3)) { - *sector_size = DEFAULT_SECTOR_SIZE; - return 0; - } -#endif if (ioctl(fd, BLKSSZGET, sector_size) >= 0) return 0; - return -1; #else *sector_size = DEFAULT_SECTOR_SIZE;