summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-cdr/cdrdao/files/cdrdao-1.2.2-excl.patch')
-rw-r--r--app-cdr/cdrdao/files/cdrdao-1.2.2-excl.patch70
1 files changed, 0 insertions, 70 deletions
diff --git a/app-cdr/cdrdao/files/cdrdao-1.2.2-excl.patch b/app-cdr/cdrdao/files/cdrdao-1.2.2-excl.patch
deleted file mode 100644
index ffc6d99a40db..000000000000
--- a/app-cdr/cdrdao/files/cdrdao-1.2.2-excl.patch
+++ /dev/null
@@ -1,70 +0,0 @@
-diff -ur cdrdao-1.2.2.orig/dao/main.cc cdrdao-1.2.2/dao/main.cc
---- cdrdao-1.2.2.orig/dao/main.cc 2006-09-19 12:07:11.000000000 +0300
-+++ cdrdao-1.2.2/dao/main.cc 2008-06-10 20:57:36.000000000 +0300
-@@ -2027,6 +2027,8 @@
- }
-
- if (src == dst) {
-+ // unlock src to make swaping possible
-+ src->preventMediumRemoval(0);
- message(0, "Please insert a recordable medium and hit enter.");
- getc(stdin);
- }
-diff -ur cdrdao-1.2.2.orig/scsilib/libscg/scsi-linux-sg.c cdrdao-1.2.2/scsilib/libscg/scsi-linux-sg.c
---- cdrdao-1.2.2.orig/scsilib/libscg/scsi-linux-sg.c 2006-09-20 13:51:11.000000000 +0300
-+++ cdrdao-1.2.2/scsilib/libscg/scsi-linux-sg.c 2008-06-10 20:57:36.000000000 +0300
-@@ -225,6 +225,27 @@
- #endif
- LOCAL void sg_settimeout __PR((int f, int timeout));
-
-+int sg_open_excl __PR((char *device, int mode));
-+
-+int
-+sg_open_excl(device, mode)
-+ char *device;
-+ int mode;
-+{
-+ int f;
-+ int i;
-+ f = open(device, mode|O_EXCL);
-+ for (i = 0; (i < 10) && (f == -1 && (errno == EACCES || errno == EBUSY)); i++) {
-+ fprintf(stderr, "Error trying to open %s exclusively (%s)... retrying in 1 second.\n", device, strerror(errno));
-+ usleep(1000000 + 100000.0 * rand()/(RAND_MAX+1.0));
-+ f = open(device, mode|O_EXCL);
-+ }
-+ if (f == -1 && errno != EACCES && errno != EBUSY) {
-+ f = open(device, mode);
-+ }
-+ return f;
-+}
-+
- /*
- * Return version information for the low level SCSI transport code.
- * This has been introduced to make it easier to trace down problems
-@@ -407,7 +428,7 @@
-
- for (i = 0; globbuf.gl_pathv && globbuf.gl_pathv[i] != NULL ; i++) {
- devname = globbuf.gl_pathv[i];
-- f = open(devname, O_RDWR | O_NONBLOCK);
-+ f = sg_open_excl(devname, O_RDWR | O_NONBLOCK);
- if (f < 0) {
- /*
- * Set up error string but let us clear it later
-@@ -458,7 +479,7 @@
- for (i = 0; globbuf.gl_pathv && globbuf.gl_pathv[i] != NULL ; i++) {
- devname = globbuf.gl_pathv[i];
-
-- f = open(devname, O_RDWR | O_NONBLOCK);
-+ f = sg_open_excl(devname, O_RDWR | O_NONBLOCK);
- if (f < 0) {
- /*
- * Set up error string but let us clear it later
-@@ -511,7 +532,7 @@
- "Warning: Open by 'devname' is unintentional and not supported.\n");
- }
- /* O_NONBLOCK is dangerous */
-- f = open(device, O_RDWR | O_NONBLOCK);
-+ f = sg_open_excl(device, O_RDWR | O_NONBLOCK);
- /* if (f < 0 && errno == ENOENT)*/
- /* goto openpg;*/
-