1 diff -pur eject-1/eject.c eject/eject.c
2 --- eject-1/eject.c 2011-08-19 11:42:22.697388647 +0400
3 +++ eject/eject.c 2011-08-19 11:57:27.636724026 +0400
4 @@ -911,7 +911,12 @@ static void Unmount(const char *fullName
5 /* Open a device file. */
6 static int OpenDevice(const char *fullName)
8 - int fd = open(fullName, O_RDONLY|O_NONBLOCK);
9 + int fd = open(fullName, O_RDWR|O_NONBLOCK);
10 + if (fd == -1 && errno == EACCES) {
12 + printf(_("%s: unable to open `%s' for R/W, SCSI commands can be fail. Trying Read-Only\n"), programName, fullName);
13 + fd = open(fullName, O_RDONLY|O_NONBLOCK);
16 fprintf(stderr, _("%s: unable to open `%s'\n"), programName, fullName);