[Debburn-changes] r718 - cdrkit/trunk/libusal
Eduard Bloch
blade at alioth.debian.org
Sat Mar 31 15:53:01 UTC 2007
Author: blade
Date: 2007-03-31 15:53:01 +0000 (Sat, 31 Mar 2007)
New Revision: 718
Modified:
cdrkit/trunk/libusal/scsi-linux-sg.c
Log:
Also apply the sg->blockdev mapping on explicite /dev/sr0 spec
Modified: cdrkit/trunk/libusal/scsi-linux-sg.c
===================================================================
--- cdrkit/trunk/libusal/scsi-linux-sg.c 2007-03-31 15:37:53 UTC (rev 717)
+++ cdrkit/trunk/libusal/scsi-linux-sg.c 2007-03-31 15:53:01 UTC (rev 718)
@@ -539,12 +539,18 @@
if (device != NULL && *device != '\0') {
b = -1;
+ char buf[100];
if (strlen(device) == 8 && strncmp(device, "/dev/hd", 7) == 0) {
b = device[7] - 'a';
if (b < 0 || b > 25)
b = -1;
}
/* O_NONBLOCK is dangerous */
+ if(0==strncmp(device, "/dev/sg", 7)) {
+ strncpy(buf, device, sizeof(buf)-1);
+ map_sg_to_block(buf, sizeof(buf));
+ device=buf;
+ }
f = sg_open_excl(device, O_RDWR | O_NONBLOCK);
/* if (f < 0 && errno == ENOENT)*/
/* goto openpg;*/
More information about the Debburn-changes
mailing list