summaryrefslogtreecommitdiff
path: root/extra/eject/eject-2.1.5-openrw.patch
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2011-08-21 23:14:35 +0000
committerroot <root@rshg054.dnsready.net>2011-08-21 23:14:35 +0000
commite9a5c646563c984f362db1777f8c6bc7da63a4ab (patch)
tree709694a1605c0b60dc9c0c57718e7fd661924646 /extra/eject/eject-2.1.5-openrw.patch
parent839141249778baa4dba0f0511c52b5eded3cd934 (diff)
Sun Aug 21 23:14:34 UTC 2011
Diffstat (limited to 'extra/eject/eject-2.1.5-openrw.patch')
-rw-r--r--extra/eject/eject-2.1.5-openrw.patch17
1 files changed, 17 insertions, 0 deletions
diff --git a/extra/eject/eject-2.1.5-openrw.patch b/extra/eject/eject-2.1.5-openrw.patch
new file mode 100644
index 000000000..092bfcfda
--- /dev/null
+++ b/extra/eject/eject-2.1.5-openrw.patch
@@ -0,0 +1,17 @@
+diff -pur eject-1/eject.c eject/eject.c
+--- eject-1/eject.c 2011-08-19 11:42:22.697388647 +0400
++++ eject/eject.c 2011-08-19 11:57:27.636724026 +0400
+@@ -911,7 +911,12 @@ static void Unmount(const char *fullName
+ /* Open a device file. */
+ static int OpenDevice(const char *fullName)
+ {
+- int fd = open(fullName, O_RDONLY|O_NONBLOCK);
++ int fd = open(fullName, O_RDWR|O_NONBLOCK);
++ if (fd == -1 && errno == EACCES) {
++ if (v_option)
++ printf(_("%s: unable to open `%s' for R/W, SCSI commands can be fail. Trying Read-Only\n"), programName, fullName);
++ fd = open(fullName, O_RDONLY|O_NONBLOCK);
++ }
+ if (fd == -1) {
+ fprintf(stderr, _("%s: unable to open `%s'\n"), programName, fullName);
+ exit(1);