summaryrefslogtreecommitdiff
blob: 613a75b228e88bb91fd77b641a659b80b0407cbb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff -urN eject-2.0.13deb.orig/eject.c eject-2.0.13deb/eject.c
--- eject-2.0.13deb.orig/eject.c	2005-12-19 16:20:43.000000000 -0500
+++ eject-2.0.13deb/eject.c	2005-12-19 16:23:08.000000000 -0500
@@ -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);