Annotation of /trunk/eject/patches/eject-2.1.5-scsi-rdwr.patch
Parent Directory | Revision Log
Revision 903 -
(hide annotations)
(download)
Fri Oct 16 16:19:38 2009 UTC (14 years, 11 months ago) by niro
File size: 466 byte(s)
Fri Oct 16 16:19:38 2009 UTC (14 years, 11 months ago) by niro
File size: 466 byte(s)
-added several fixed
1 | niro | 903 | http://bugs.gentoo.org/116731 |
2 | |||
3 | --- eject-2.0.13/eject.c | ||
4 | +++ eject-2.0.13/eject.c | ||
5 | @@ -657,7 +657,15 @@ | ||
6 | /* Open a device file. */ | ||
7 | static int OpenDevice(const char *fullName) | ||
8 | { | ||
9 | - int fd = open(fullName, O_RDONLY|O_NONBLOCK); | ||
10 | + int flags = O_NONBLOCK; | ||
11 | + int fd; | ||
12 | + | ||
13 | + if (s_option) | ||
14 | + flags |= O_RDWR; | ||
15 | + else | ||
16 | + flags |= O_RDONLY; | ||
17 | + | ||
18 | + fd = open(fullName, flags); | ||
19 | if (fd == -1) { | ||
20 | fprintf(stderr, _("%s: unable to open `%s'\n"), programName, fullName); | ||
21 | exit(1); |