Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2001-02-05 19:10:06 +0300
committerCorinna Vinschen <corinna@vinschen.de>2001-02-05 19:10:06 +0300
commitae9b22c69b7374129d872cde66290c925a0c9857 (patch)
treecca1713686b18ff588f7c3a7f8ef8409aea86aeb /winsup/cygwin/fhandler.cc
parentcada03f92f6d9f2126ab8dd094a740bdeb673103 (diff)
* fhandler.cc (fhandler_base::open): Always add GENERIC_READ access
when opening raw disk devices. * fhandler_floppy.cc (fhandler_dev_floppy::lseek): Implement bytewise access. * fhandler_raw.cc (fhandler_dev_raw::open): Always open raw disk device binary. (fhandler_dev_raw::raw_write): Don't drop read buffer content when writing after read.
Diffstat (limited to 'winsup/cygwin/fhandler.cc')
-rw-r--r--winsup/cygwin/fhandler.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc
index f6779614a..1c9e600a8 100644
--- a/winsup/cygwin/fhandler.cc
+++ b/winsup/cygwin/fhandler.cc
@@ -324,6 +324,12 @@ fhandler_base::open (int flags, mode_t mode)
access_ = GENERIC_READ | GENERIC_WRITE;
}
+ /* Allow reliable lseek on disk devices. */
+ if (get_device () == FH_FLOPPY)
+ {
+ access_ |= GENERIC_READ;
+ }
+
/* FIXME: O_EXCL handling? */
if ((flags & O_TRUNC) && ((flags & O_ACCMODE) != O_RDONLY))