View | Details | Raw Unified | Return to bug 22664 | Differences between
and this patch

Collapse All | Expand All

(-)mount_cd9660.c (+29 lines)
Lines 145-150 Link Here
145
	args.export.ex_root = DEFAULT_ROOTUID;
145
	args.export.ex_root = DEFAULT_ROOTUID;
146
	args.flags = opts;
146
	args.flags = opts;
147
147
148
	switch(is_medium_data(dev)) {
149
		case -1:	errx(EX_OSERR, "error reading medium type!");
150
		case 0:		errx(EX_DATAERR, "medium type is not data!");
151
	}
152
				
148
	if (args.ssector == -1) {
153
	if (args.ssector == -1) {
149
		/*
154
		/*
150
		 * The start of the session has not been specified on
155
		 * The start of the session has not been specified on
Lines 228-231 Link Here
228
		return -1;
233
		return -1;
229
234
230
	return ntohl(toc_buffer[i].addr.lba);
235
	return ntohl(toc_buffer[i].addr.lba);
236
}
237
238
int
239
is_medium_data(const char *dev)
240
{
241
	struct ioc_medium m;
242
	int fd;
243
244
	if ((fd = open(dev, O_RDONLY)) == -1)
245
		return -1;
246
	if (ioctl(fd, CDIOCGETMEDIUM, &m) == -1) {
247
		perror("ioctl");
248
		close(fd);
249
		return -1;
250
	}
251
	close(fd);
252
	switch (m.medium_type & MST_TYPE_MASK_LOW)
253
	{
254
		case MST_DATA_120:	return(1);
255
		case MST_COMB_120:	return(1);
256
		case MST_DATA_80:	return(1);
257
		case MST_COMB_80:	return(1);
258
	}
259
	return(0);
231
}
260
}

Return to bug 22664