blob: cd5e497b9d9a3e287b5400986c1014b0c6fda0c0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
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);
|