From 047f9c75f5264426332ba64062c8b053246c0630 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Tue, 10 Apr 2007 08:31:04 +0000 Subject: [PATCH] Fixed bug in sg_open_scsi_siblings() introduced with revision 802 --- cdrskin/cdrskin_timestamp.h | 2 +- libburn/sg-linux.c | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cdrskin/cdrskin_timestamp.h b/cdrskin/cdrskin_timestamp.h index 47a4ec3..979dfa2 100644 --- a/cdrskin/cdrskin_timestamp.h +++ b/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2007.04.10.082229" +#define Cdrskin_timestamP "2007.04.10.083119" diff --git a/libburn/sg-linux.c b/libburn/sg-linux.c index adc8d9d..b72c109 100644 --- a/libburn/sg-linux.c +++ b/libburn/sg-linux.c @@ -433,11 +433,15 @@ static int sg_open_scsi_siblings(char *path, int driveno, int i_host_no = -1, i_channel_no = -1, i_target_no = -1, i_lun_no = -1; char msg[161], fname[81]; struct stat stbuf; - dev_t last_rdev = 0; + dev_t last_rdev = 0, path_rdev; static char tldev[][81]= {"/dev/sr%d", "/dev/scd%d", "/dev/sg%d", ""}; /* ts A70609: removed "/dev/st%d" */ + if(stat(path, &stbuf) == -1) + return 0; + path_rdev = stbuf.st_rdev; + sg_select_device_family(); if (linux_sg_device_family[0] == 0) return 1; @@ -454,6 +458,8 @@ static int sg_open_scsi_siblings(char *path, int driveno, for (i = 0; i < 32; i++) { sprintf(fname, tldev[tld], i); if(stat(fname, &stbuf) == -1) + continue; + if (path_rdev == stbuf.st_rdev) continue; if (*sibling_count > 0 && last_rdev == stbuf.st_rdev) continue;