Sophie

Sophie

distrib > Mandriva > current > x86_64 > by-pkgid > 5bc35d49c2e5e1bb0e86968ae1779db0 > files > 2

eject-2.1.5-8mdv2010.1.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);