View | Details | Raw Unified | Return to bug 220186
Collapse All | Expand All

(-)b/usr.sbin/bhyveload/bhyveload.c (-3 / +5 lines)
Lines 311-320 cb_diskioctl(void *arg, int unit, u_long cmd, void *data) Link Here
311
		*(u_int *)data = 512;
311
		*(u_int *)data = 512;
312
		break;
312
		break;
313
	case DIOCGMEDIASIZE:
313
	case DIOCGMEDIASIZE:
314
		if (fstat(disk_fd[unit], &sb) == 0)
314
		if (fstat(disk_fd[unit], &sb) != 0)
315
			*(off_t *)data = sb.st_size;
316
		else
317
			return (ENOTTY);
315
			return (ENOTTY);
316
		if (S_ISCHR(sb.st_mode) &&
317
		    ioctl(disk_fd[unit], DIOCGMEDIASIZE, &sb.st_size) != 0)
318
				return (ENOTTY);
319
		*(off_t *)data = sb.st_size;
318
		break;
320
		break;
319
	default:
321
	default:
320
		return (ENOTTY);
322
		return (ENOTTY);

Return to bug 220186