Sophie

Sophie

distrib > Mandriva > 2009.0 > i586 > by-pkgid > 514e1ab4804215e72fcbca147944180f > files > 2

eject-2.1.5-5.1mdv2009.0.src.rpm

http://bugs.gentoo.org/116731

--- eject-2.0.13/eject.c
+++ eject-2.0.13/eject.c
@@ -657,7 +657,15 @@
 /* Open a device file. */
 static int OpenDevice(const char *fullName)
 {
-	int fd = open(fullName, O_RDONLY|O_NONBLOCK);
+	int flags = O_NONBLOCK;
+	int fd;
+
+ 	if (s_option)
+		flags |= O_RDWR;
+	else
+		flags |= O_RDONLY;
+
+	fd = open(fullName, flags);
 	if (fd == -1) {
 		fprintf(stderr, _("%s: unable to open `%s'\n"), programName, fullName);
 		exit(1);